diff --git a/src/front/dist/assets/AboutInspectionPage-194af9dc.js b/src/front/dist/assets/AboutInspectionPage-168ec125.js similarity index 89% rename from src/front/dist/assets/AboutInspectionPage-194af9dc.js rename to src/front/dist/assets/AboutInspectionPage-168ec125.js index 19641e670..09b2b35de 100644 --- a/src/front/dist/assets/AboutInspectionPage-194af9dc.js +++ b/src/front/dist/assets/AboutInspectionPage-168ec125.js @@ -1,4 +1,4 @@ -import{_ as Xt,O as on,P as sn,s as V,t as ot,v as f,x as d,E as T,M as j,$ as tt,D as R,c3 as gr,r as G,aE as Co,Q as vt,aP as Ji,R as Ct,T as Yt,S as Ht,U as Ne,K as st,C as yt,y as F,a4 as vr,z as yr,V as Ve,bk as oe,k as se,q as re,cO as Mt,bK as xe,n as Jt,bz as ae,b as xr,p as Ft,f as ci,e as rn,w as bo,bW as an,c2 as wr,cQ as br,g as Lr,a5 as pi,B as dt,a3 as Xi,cT as Qi,Z as tn,X as Pr,W as Tr,Y as Sr,cG as Cr,A as Mo,c as zo,d4 as Mr,cV as zr}from"./index-84cc8e63.js";import{V as en}from"./VList-d0850642.js";import{P as kr}from"./PatternTabs-42032570.js";import{V as Or}from"./VForm-22e5b970.js";import{V as Yi}from"./VTextField-4eb073db.js";import{V as Ar}from"./VTextarea-08b60249.js";import{V as Er}from"./VFileInput-ac5ef80a.js";import{a as di}from"./VWindowItem-bd3460f3.js";import"./ssrBoot-04c9ae84.js";import"./VInput-e5a7e0e7.js";/* empty css */import"./VField-e3c852c7.js";function Ir(c,h){for(var a=0;al[m]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}const Br={props:{sText:{type:String,default:""}},setup(){return{checkremote:on,spravURL:sn}}},Zr={class:"vertext text-button my-1 pb-13"};function Rr(c,h,a,l,m,y){return V(),ot(R,{"no-gutters":"",class:"h-100"},{default:f(()=>[d(T,{class:"align-self-center flex-grow-0"},{default:f(()=>[j("span",Zr,tt(a.sText),1)]),_:1}),d(T,{class:"w100"},{default:f(()=>[a.sText=="Руководство"?(V(),ot(R,{key:0,"no-gutters":"",class:"text-center text-button py-2"})):(V(),ot(R,{key:1,"no-gutters":"",class:"text-center text-button py-2"})),d(R,{"no-gutters":"",class:"h-100"},{default:f(()=>[gr(c.$slots,"cardboss")]),_:3})]),_:3})]),_:3})}const Dr=Xt(Br,[["render",Rr]]);const Nr={components:{StructureInspectionRow:Dr},setup(){const c=G([]),{smAndDown:h,mdAndDown:a,lgAndDown:l}=Co();return(()=>{Ne.get("api/about_inspection/getstructure/").then(y=>{c.value=y.data})})(),{structures:c,checkremote:on,spravURL:sn,mdAndDown:a,lgAndDown:l,smAndDown:h}}},Vr=j("span",{class:"vertext text-button my-1 pb-8"},"Руководство",-1),Fr=j("span",{class:"vertext text-button my-1 pb-13"},"Структурные подразделения",-1);function Hr(c,h,a,l,m,y){const g=vt("list-user");return V(),ot(R,{"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{class:"flex-grow-0 d-flex d-sm-none d-lg-none d-xl-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"flex-column"},{default:f(()=>[d(T,{lg:"4"},{default:f(()=>[Vr]),_:1}),d(T,null,{default:f(()=>[Fr]),_:1})]),_:1})]),_:1}),d(T,{class:"d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:Ji(l.smAndDown?" flex-column":"")},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.structures,x=>(V(),ot(T,{md:l.mdAndDown?"12":"",lg:l.lgAndDown?6:"",class:"w100 flex-column d-flex",key:x.id},{default:f(()=>[d(R,{"no-gutters":"",class:"flex-grow-0"},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"mb-2 mt-1 justify-center d-flex mx-1"},{default:f(()=>[d(st,{class:"flex-column d-flex flex-grow-1",elevation:10},{default:f(()=>[d(yt,{class:"pa-0"},{default:f(()=>[d(T,{lg:"12",class:"pa-0"},{default:f(()=>[d(R,{"no-gutters":""},{default:f(()=>[d(T,{class:"d-flex py-3 justify-center align-center font-weight-medium text-uppercase"},{default:f(()=>[F(tt(x.post),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":""},{default:f(()=>[d(T,{lg:"4",class:"pa-1 heightfoto"},{default:f(()=>[d(g,{author:x,from_which:"top_comment"},null,8,["author"])]),_:2},1024),d(T,{class:"text-center align-self-center font-weight-medium"},{default:f(()=>[F(tt(x.fio),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":"",class:Ji(l.lgAndDown?"":"gap h-0 overflow-auto")},{default:f(()=>[d(T,{lg:"12"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(x.deps,v=>(V(),ot(R,{"no-gutters":"",class:"gap mb-1",key:v.id},{default:f(()=>[d(T,{class:"d-flex flex-column"},{default:f(()=>[d(st,{class:"flex-column d-flex flex-grow-1 mx-1",elevation:5},{default:f(()=>[d(yt,{class:"pa-1 pt-3 px-3 flex-column"},{default:f(()=>[d(T,{lg:"12",class:"minh pa-0"},{default:f(()=>[d(R,{"no-gutters":""},{default:f(()=>[d(T,{class:"text-wrap text-center text-body-2 font-weight-medium text-uppercase"},{default:f(()=>[F(tt(v.name),1)]),_:2},1024),d(T,{class:"flex-grow-0"},{default:f(()=>[d(vr,{location:"top"},{activator:f(({props:M})=>[j("span",yr({ref_for:!0},M),[d(Ve,{size:"large",color:"green",icon:"mdi-arrow-top-right"})],16)]),default:f(()=>[d(R,null,{default:f(()=>[d(T,null,{default:f(()=>[F(" Перейти на страницу отдела ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":""},{default:f(()=>[d(g,{author:v.chief_deps},null,8,["author"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["class"])]),_:2},1032,["md","lg"]))),128))]),_:1},8,["class"])]),_:1})]),_:1})}const Wr=Xt(Nr,[["render",Hr]]);const Lo=(c,h)=>{for(const a of Object.keys(h))c.on(a,h[a])},ko=c=>{for(const h of Object.keys(c)){const a=c[h];a&&$t(a.cancel)&&a.cancel()}},jr=c=>!c||typeof c.charAt!="function"?c:c.charAt(0).toUpperCase()+c.slice(1),$t=c=>typeof c=="function",le=(c,h,a)=>{for(const l in a){const m="set"+jr(l);c[m]?bo(()=>a[l],(y,g)=>{c[m](y,g)}):h[m]&&bo(()=>a[l],y=>{h[m](y)})}},ue=(c,h,a={})=>{const l={...a};for(const m in c){const y=h[m],g=c[m];y&&(y&&y.custom===!0||g!==void 0&&(l[m]=g))}return l},we=c=>{const h={},a={};for(const l in c)if(l.startsWith("on")&&!l.startsWith("onUpdate")&&l!=="onReady"){const m=l.slice(2).toLocaleLowerCase();h[m]=c[l]}else a[l]=c[l];return{listeners:h,attrs:a}},Ur=async c=>{const h=await Promise.all([Mt(()=>import("./marker-icon-2x-e148f0f7.js"),[]),Mt(()=>import("./marker-icon-d6994ad0.js"),[]),Mt(()=>import("./marker-shadow-a7f70f89.js"),[])]);delete c.Default.prototype._getIconUrl,c.Default.mergeOptions({iconRetinaUrl:h[0].default,iconUrl:h[1].default,shadowUrl:h[2].default})},fi=c=>{const h=G((...l)=>console.warn(`Method ${c} has been invoked without being replaced`)),a=(...l)=>h.value(...l);return a.wrapped=h,Ft(c,a),a},_i=(c,h)=>c.wrapped.value=h,Wt=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||globalThis,zt=c=>{const h=se(c);if(h===void 0)throw new Error(`Attempt to inject ${c.description} before it was provided.`);return h},he=Symbol("useGlobalLeaflet"),He=Symbol("addLayer"),Oo=Symbol("removeLayer"),Ao=Symbol("registerControl"),Gr=Symbol("registerLayerControl"),Eo=Symbol("canSetParentHtml"),Io=Symbol("setParentHtml"),Bo=Symbol("setIcon"),qr=Symbol("bindPopup"),Zo=Symbol("bindTooltip"),Kr=Symbol("unbindPopup"),Ro=Symbol("unbindTooltip"),We={options:{type:Object,default:()=>({}),custom:!0}},je=c=>({options:c.options,methods:{}}),be={...We,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},Do=(c,h,a)=>{const l=zt(He),m=zt(Oo),{options:y,methods:g}=je(c),x=ue(c,be,y),v=()=>l({leafletObject:h.value}),M=()=>m({leafletObject:h.value}),P={...g,setAttribution(S){M(),h.value.options.attribution=S,c.visible&&v()},setName(){M(),c.visible&&v()},setLayerType(){M(),c.visible&&v()},setVisible(S){h.value&&(S?v():M())},bindPopup(S){if(!h.value||!$t(h.value.bindPopup)){console.warn("Attempt to bind popup before bindPopup method available on layer.");return}h.value.bindPopup(S)},bindTooltip(S){if(!h.value||!$t(h.value.bindTooltip)){console.warn("Attempt to bind tooltip before bindTooltip method available on layer.");return}h.value.bindTooltip(S)},unbindTooltip(){h.value&&($t(h.value.closeTooltip)&&h.value.closeTooltip(),$t(h.value.unbindTooltip)&&h.value.unbindTooltip())},unbindPopup(){h.value&&($t(h.value.closePopup)&&h.value.closePopup(),$t(h.value.unbindPopup)&&h.value.unbindPopup())},updateVisibleProp(S){a.emit("update:visible",S)}};return Ft(qr,P.bindPopup),Ft(Zo,P.bindTooltip),Ft(Kr,P.unbindPopup),Ft(Ro,P.unbindTooltip),an(()=>{P.unbindPopup(),P.unbindTooltip(),M()}),{options:x,methods:P}},$r=(c,h)=>{if(c&&h.default)return ae("div",{style:{display:"none"}},h.default())},Yr={...be,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},No={...Yr,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},Jr={...No,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}};({...Jr});const Le={...We,position:{type:String}},Xr=(c,h)=>{const{options:a,methods:l}=je(c),m=ue(c,Le,a),y={...l,setPosition(g){h.value&&h.value.setPosition(g)}};return an(()=>{h.value&&h.value.remove()}),{options:m,methods:y}},Qr=c=>c.default?ae("div",{ref:"root"},c.default()):null;oe({name:"LControl",props:{...Le,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(c,h){const a=G(),l=G(),m=se(he),y=zt(Ao),{options:g,methods:x}=Xr(c,a);return re(async()=>{const{Control:v,DomEvent:M}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]),P=v.extend({onAdd(){return l.value}});a.value=xe(new P(g)),le(x,a.value,c),y({leafletObject:a.value}),c.disableClickPropagation&&l.value&&M.disableClickPropagation(l.value),c.disableScrollPropagation&&l.value&&M.disableScrollPropagation(l.value),Jt(()=>h.emit("ready",a.value))}),{root:l,leafletObject:a}},render(){return Qr(this.$slots)}});({...Le});({...Le});({...Le});({...Le});const Vo={...be};({...Vo});({...Vo});const ln={...be,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number},className:{type:String}},Fo=(c,h,a)=>{const{options:l,methods:m}=Do(c,h,a),y=ue(c,ln,l),g={...m,setTileComponent(){var x;(x=h.value)==null||x.redraw()}};return an(()=>{h.value.off()}),{options:y,methods:g}},ta=(c,h,a,l)=>c.extend({initialize(m){this.tileComponents={},this.on("tileunload",this._unloadTile),a.setOptions(this,m)},createTile(m){const y=this._tileCoordsToKey(m);this.tileComponents[y]=h.create("div");const g=ae({setup:l,props:["coords"]},{coords:m});return wr(g,this.tileComponents[y]),this.tileComponents[y]},_unloadTile(m){const y=this._tileCoordsToKey(m.coords);this.tileComponents[y]&&(this.tileComponents[y].innerHTML="",this.tileComponents[y]=void 0)}});oe({props:{...ln,childRender:{type:Function,required:!0}},setup(c,h){const a=G(),l=G(null),m=G(!1),y=se(he),g=zt(He),{options:x,methods:v}=Fo(c,a,h);return re(async()=>{const{GridLayer:M,DomUtil:P,Util:S}=y?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]),q=ta(M,P,S,c.childRender);a.value=xe(new q(x));const{listeners:H}=we(h.attrs);a.value.on(H),le(v,a.value,c),g({...c,...v,leafletObject:a.value}),m.value=!0,Jt(()=>h.emit("ready",a.value))}),{root:l,ready:m,leafletObject:a}},render(){return this.ready?ae("div",{style:{display:"none"},ref:"root"}):null}});const Po={iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}};oe({name:"LIcon",props:{...Po,...We},setup(c,h){const a=G(),l=se(he),m=zt(Eo),y=zt(Io),g=zt(Bo);let x,v,M,P,S;const q=(xt,X,rt)=>{const K=xt&&xt.innerHTML;if(!X){rt&&S&&m()&&y(K);return}const{listeners:kt}=we(h.attrs);S&&v(S,kt);const{options:jt}=je(c),mt=ue(c,Po,jt);K&&(mt.html=K),S=mt.html?M(mt):P(mt),x(S,kt),g(S)},H=()=>{Jt(()=>q(a.value,!0,!1))},lt=()=>{Jt(()=>q(a.value,!1,!0))},N={setIconUrl:H,setIconRetinaUrl:H,setIconSize:H,setIconAnchor:H,setPopupAnchor:H,setTooltipAnchor:H,setShadowUrl:H,setShadowRetinaUrl:H,setShadowAnchor:H,setBgPos:H,setClassName:H,setHtml:H};return re(async()=>{const{DomEvent:xt,divIcon:X,icon:rt}=l?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);x=xt.on,v=xt.off,M=X,P=rt,le(N,{},c),new MutationObserver(lt).observe(a.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),H()}),{root:a}},render(){const c=this.$slots.default?this.$slots.default():void 0;return ae("div",{ref:"root"},c)}});({...be});function Ho(c,h,a){var l,m,y;h===void 0&&(h=50),a===void 0&&(a={});var g=(l=a.isImmediate)!=null&&l,x=(m=a.callback)!=null&&m,v=a.maxWait,M=Date.now(),P=[];function S(){if(v!==void 0){var H=Date.now()-M;if(H+h>=v)return v-H}return h}var q=function(){var H=[].slice.call(arguments),lt=this;return new Promise(function(N,xt){var X=g&&y===void 0;if(y!==void 0&&clearTimeout(y),y=setTimeout(function(){if(y=void 0,M=Date.now(),!g){var K=c.apply(lt,H);x&&x(K),P.forEach(function(kt){return(0,kt.resolve)(K)}),P=[]}},S()),X){var rt=c.apply(lt,H);return x&&x(rt),N(rt)}P.push({resolve:N,reject:xt})})};return q.cancel=function(H){y!==void 0&&clearTimeout(y),P.forEach(function(lt){return(0,lt.reject)(H)}),P=[]},q}const To={...We,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},ea=oe({inheritAttrs:!1,emits:["ready","update:zoom","update:center","update:bounds"],props:To,setup(c,h){const a=G(),l=xr({ready:!1,layersToAdd:[],layersInControl:[]}),{options:m}=je(c),y=ue(c,To,m),{listeners:g,attrs:x}=we(h.attrs),v=fi(He),M=fi(Oo),P=fi(Ao),S=fi(Gr);Ft(he,c.useGlobalLeaflet);const q=ci(()=>{const X={};return c.noBlockingAnimations&&(X.animate=!1),X}),H=ci(()=>{const X=q.value;return c.padding&&(X.padding=c.padding),c.paddingTopLeft&&(X.paddingTopLeft=c.paddingTopLeft),c.paddingBottomRight&&(X.paddingBottomRight=c.paddingBottomRight),X}),lt={moveend:Ho(X=>{l.leafletRef&&(h.emit("update:zoom",l.leafletRef.getZoom()),h.emit("update:center",l.leafletRef.getCenter()),h.emit("update:bounds",l.leafletRef.getBounds()))}),overlayadd(X){const rt=l.layersInControl.find(K=>K.name===X.name);rt&&rt.updateVisibleProp(!0)},overlayremove(X){const rt=l.layersInControl.find(K=>K.name===X.name);rt&&rt.updateVisibleProp(!1)}};re(async()=>{c.useGlobalLeaflet&&(Wt.L=Wt.L||await Mt(()=>Promise.resolve().then(()=>ga),void 0));const{map:X,CRS:rt,Icon:K,latLngBounds:kt,latLng:jt,stamp:mt}=c.useGlobalLeaflet?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);try{y.beforeMapMount&&await y.beforeMapMount()}catch(I){console.error(`The following error occurred running the provided beforeMapMount hook ${I.message}`)}await Ur(K);const Ue=typeof y.crs=="string"?rt[y.crs]:y.crs;y.crs=Ue||rt.EPSG3857;const Ut={addLayer(I){I.layerType!==void 0&&(l.layerControl===void 0?l.layersToAdd.push(I):l.layersInControl.find($=>mt($.leafletObject)===mt(I.leafletObject))||(l.layerControl.addLayer(I),l.layersInControl.push(I))),I.visible!==!1&&l.leafletRef.addLayer(I.leafletObject)},removeLayer(I){I.layerType!==void 0&&(l.layerControl===void 0?l.layersToAdd=l.layersToAdd.filter($=>$.name!==I.name):(l.layerControl.removeLayer(I.leafletObject),l.layersInControl=l.layersInControl.filter($=>mt($.leafletObject)!==mt(I.leafletObject)))),l.leafletRef.removeLayer(I.leafletObject)},registerLayerControl(I){l.layerControl=I,l.layersToAdd.forEach($=>{l.layerControl.addLayer($)}),l.layersToAdd=[],P(I)},registerControl(I){l.leafletRef.addControl(I.leafletObject)},setZoom(I){const $=l.leafletRef.getZoom();I!==$&&l.leafletRef.setZoom(I,q.value)},setCrs(I){const $=l.leafletRef.getBounds();l.leafletRef.options.crs=I,l.leafletRef.fitBounds($,{animate:!1,padding:[0,0]})},fitBounds(I){l.leafletRef.fitBounds(I,H.value)},setBounds(I){if(!I)return;const $=kt(I);$.isValid()&&!(l.lastSetBounds||l.leafletRef.getBounds()).equals($,0)&&(l.lastSetBounds=$,l.leafletRef.fitBounds($))},setCenter(I){if(I==null)return;const $=jt(I),ut=l.lastSetCenter||l.leafletRef.getCenter();(ut.lat!==$.lat||ut.lng!==$.lng)&&(l.lastSetCenter=$,l.leafletRef.panTo($,q.value))}};_i(v,Ut.addLayer),_i(M,Ut.removeLayer),_i(P,Ut.registerControl),_i(S,Ut.registerLayerControl),l.leafletRef=xe(X(a.value,y)),le(Ut,l.leafletRef,c),Lo(l.leafletRef,lt),Lo(l.leafletRef,g),l.ready=!0,Jt(()=>h.emit("ready",l.leafletRef))}),rn(()=>{ko(lt),l.leafletRef&&(l.leafletRef.off(),l.leafletRef.remove())});const N=ci(()=>l.leafletRef),xt=ci(()=>l.ready);return{root:a,ready:xt,leafletObject:N,attrs:x}},render({attrs:c}){return c.style||(c.style={}),c.style.width||(c.style.width="100%"),c.style.height||(c.style.height="100%"),ae("div",{...c,ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),ia=["Symbol(Comment)","Symbol(Text)"],na=["LTooltip","LPopup"],Wo={...be,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},oa=(c,h,a)=>{const{options:l,methods:m}=Do(c,h,a),y=ue(c,Wo,l),g={...m,setDraggable(x){h.value.dragging&&(x?h.value.dragging.enable():h.value.dragging.disable())},latLngSync(x){a.emit("update:latLng",x.latlng),a.emit("update:lat-lng",x.latlng)},setLatLng(x){if(x!=null&&h.value){const v=h.value.getLatLng();(!v||!v.equals(x))&&h.value.setLatLng(x)}}};return{options:y,methods:g}},sa=(c,h)=>{const a=h.slots.default&&h.slots.default();return a&&a.length&&a.some(ra)};function ra(c){return!(ia.includes(c.type.toString())||na.includes(c.type.name))}const aa=oe({name:"LMarker",props:Wo,setup(c,h){const a=G(),l=G(!1),m=se(he),y=zt(He);Ft(Eo,()=>{var M;return!!((M=a.value)!=null&&M.getElement())}),Ft(Io,M=>{var P,S;const q=$t((P=a.value)==null?void 0:P.getElement)&&((S=a.value)==null?void 0:S.getElement());q&&(q.innerHTML=M)}),Ft(Bo,M=>{var P;return((P=a.value)==null?void 0:P.setIcon)&&a.value.setIcon(M)});const{options:g,methods:x}=oa(c,a,h),v={moveHandler:Ho(x.latLngSync)};return re(async()=>{const{marker:M,divIcon:P}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);sa(g,h)&&(g.icon=P({className:""})),a.value=xe(M(c.latLng,g));const{listeners:S}=we(h.attrs);a.value.on(S),a.value.on("move",v.moveHandler),le(x,a.value,c),y({...c,...x,leafletObject:a.value}),l.value=!0,Jt(()=>h.emit("ready",a.value))}),rn(()=>ko(v)),{ready:l,leafletObject:a}},render(){return $r(this.ready,this.$slots)}}),la={...No,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},So={...la},jo={...We,content:{type:String,default:null}},ua=(c,h)=>{const{options:a,methods:l}=je(c),m={...l,setContent(y){h.value&&y!==null&&y!==void 0&&h.value.setContent(y)}};return{options:a,methods:m}},ha=c=>c.default?ae("div",{ref:"root"},c.default()):null;({...jo});({...So,latLngs:{...So.latLngs}});const un={...ln,tms:{type:Boolean,default:void 0},subdomains:{type:[String,Array],validator:c=>typeof c=="string"?!0:Array.isArray(c)?c.every(h=>typeof h=="string"):!1},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}},ca=(c,h,a)=>{const{options:l,methods:m}=Fo(c,h,a),y=ue(c,un,l),g={...m};return{options:y,methods:g}},da=oe({props:un,setup(c,h){const a=G(),l=se(he),m=zt(He),{options:y,methods:g}=ca(c,a,h);return re(async()=>{const{tileLayer:x}=l?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);a.value=xe(x(c.url,y));const{listeners:v}=we(h.attrs);a.value.on(v),le(g,a.value,c),m({...c,...g,leafletObject:a.value}),Jt(()=>h.emit("ready",a.value))}),{leafletObject:a}},render(){return null}}),fa={...jo},_a=(c,h)=>{const{options:a,methods:l}=ua(c,h),m=zt(Ro);return rn(()=>{m()}),{options:a,methods:l}},pa=oe({name:"LTooltip",props:fa,setup(c,h){const a=G(),l=G(null),m=se(he),y=zt(Zo),{options:g,methods:x}=_a(c,a);return re(async()=>{const{tooltip:v}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);a.value=xe(v(g)),le(x,a.value,c);const{listeners:M}=we(h.attrs);a.value.on(M),a.value.setContent(c.content||l.value||""),y(a.value),Jt(()=>h.emit("ready",a.value))}),{root:l,leafletObject:a}},render(){return ha(this.$slots)}});({...un});var nn={exports:{}};/* @preserve +import{_ as Xt,O as on,P as sn,s as V,t as ot,v as f,x as d,E as T,M as j,$ as tt,D as R,c3 as gr,r as G,aE as Co,Q as vt,aP as Ji,R as Ct,T as Yt,S as Ht,U as Ne,K as st,C as yt,y as F,a4 as vr,z as yr,V as Ve,bk as oe,k as se,q as re,cO as Mt,bK as xe,n as Jt,bz as ae,b as xr,p as Ft,f as ci,e as rn,w as bo,bW as an,c2 as wr,cQ as br,g as Lr,a5 as pi,B as dt,a3 as Xi,cT as Qi,Z as tn,X as Pr,W as Tr,Y as Sr,cG as Cr,A as Mo,c as zo,d4 as Mr,cV as zr}from"./index-f3f24177.js";import{V as en}from"./VList-983e49dd.js";import{P as kr}from"./PatternTabs-b63c46f1.js";import{V as Or}from"./VForm-36904946.js";import{V as Yi}from"./VTextField-2c3c89ba.js";import{V as Ar}from"./VTextarea-d04410cf.js";import{V as Er}from"./VFileInput-b0d8c050.js";import{a as di}from"./VWindowItem-903bb0f4.js";import"./ssrBoot-4527a6ac.js";import"./VTabs-cea59e65.js";import"./VInput-3de7b4b2.js";/* empty css */import"./VField-ac1e4507.js";function Ir(c,h){for(var a=0;al[m]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}const Br={props:{sText:{type:String,default:""}},setup(){return{checkremote:on,spravURL:sn}}},Zr={class:"vertext text-button my-1 pb-13"};function Rr(c,h,a,l,m,y){return V(),ot(R,{"no-gutters":"",class:"h-100"},{default:f(()=>[d(T,{class:"align-self-center flex-grow-0"},{default:f(()=>[j("span",Zr,tt(a.sText),1)]),_:1}),d(T,{class:"w100"},{default:f(()=>[a.sText=="Руководство"?(V(),ot(R,{key:0,"no-gutters":"",class:"text-center text-button py-2"})):(V(),ot(R,{key:1,"no-gutters":"",class:"text-center text-button py-2"})),d(R,{"no-gutters":"",class:"h-100"},{default:f(()=>[gr(c.$slots,"cardboss")]),_:3})]),_:3})]),_:3})}const Dr=Xt(Br,[["render",Rr]]);const Nr={components:{StructureInspectionRow:Dr},setup(){const c=G([]),{smAndDown:h,mdAndDown:a,lgAndDown:l}=Co();return(()=>{Ne.get("api/about_inspection/getstructure/").then(y=>{c.value=y.data})})(),{structures:c,checkremote:on,spravURL:sn,mdAndDown:a,lgAndDown:l,smAndDown:h}}},Vr=j("span",{class:"vertext text-button my-1 pb-8"},"Руководство",-1),Fr=j("span",{class:"vertext text-button my-1 pb-13"},"Структурные подразделения",-1);function Hr(c,h,a,l,m,y){const g=vt("list-user");return V(),ot(R,{"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{class:"flex-grow-0 d-flex d-sm-none d-lg-none d-xl-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"flex-column"},{default:f(()=>[d(T,{lg:"4"},{default:f(()=>[Vr]),_:1}),d(T,null,{default:f(()=>[Fr]),_:1})]),_:1})]),_:1}),d(T,{class:"d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:Ji(l.smAndDown?" flex-column":"")},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.structures,x=>(V(),ot(T,{md:l.mdAndDown?"12":"",lg:l.lgAndDown?6:"",class:"w100 flex-column d-flex",key:x.id},{default:f(()=>[d(R,{"no-gutters":"",class:"flex-grow-0"},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"mb-2 mt-1 justify-center d-flex mx-1"},{default:f(()=>[d(st,{class:"flex-column d-flex flex-grow-1",elevation:10},{default:f(()=>[d(yt,{class:"pa-0"},{default:f(()=>[d(T,{lg:"12",class:"pa-0"},{default:f(()=>[d(R,{"no-gutters":""},{default:f(()=>[d(T,{class:"d-flex py-3 justify-center align-center font-weight-medium text-uppercase"},{default:f(()=>[F(tt(x.post),1)]),_:2},1024)]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":""},{default:f(()=>[d(T,{lg:"4",class:"pa-1 heightfoto"},{default:f(()=>[d(g,{author:x,from_which:"top_comment"},null,8,["author"])]),_:2},1024),d(T,{class:"text-center align-self-center font-weight-medium"},{default:f(()=>[F(tt(x.fio),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":"",class:Ji(l.lgAndDown?"":"gap h-0 overflow-auto")},{default:f(()=>[d(T,{lg:"12"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(x.deps,v=>(V(),ot(R,{"no-gutters":"",class:"gap mb-1",key:v.id},{default:f(()=>[d(T,{class:"d-flex flex-column"},{default:f(()=>[d(st,{class:"flex-column d-flex flex-grow-1 mx-1",elevation:5},{default:f(()=>[d(yt,{class:"pa-1 pt-3 px-3 flex-column"},{default:f(()=>[d(T,{lg:"12",class:"minh pa-0"},{default:f(()=>[d(R,{"no-gutters":""},{default:f(()=>[d(T,{class:"text-wrap text-center text-body-2 font-weight-medium text-uppercase"},{default:f(()=>[F(tt(v.name),1)]),_:2},1024),d(T,{class:"flex-grow-0"},{default:f(()=>[d(vr,{location:"top"},{activator:f(({props:M})=>[j("span",yr({ref_for:!0},M),[d(Ve,{size:"large",color:"green",icon:"mdi-arrow-top-right"})],16)]),default:f(()=>[d(R,null,{default:f(()=>[d(T,null,{default:f(()=>[F(" Перейти на страницу отдела ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:2},1024)]),_:2},1024),d(R,{"no-gutters":""},{default:f(()=>[d(g,{author:v.chief_deps},null,8,["author"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["class"])]),_:2},1032,["md","lg"]))),128))]),_:1},8,["class"])]),_:1})]),_:1})}const Wr=Xt(Nr,[["render",Hr]]);const Lo=(c,h)=>{for(const a of Object.keys(h))c.on(a,h[a])},ko=c=>{for(const h of Object.keys(c)){const a=c[h];a&&$t(a.cancel)&&a.cancel()}},jr=c=>!c||typeof c.charAt!="function"?c:c.charAt(0).toUpperCase()+c.slice(1),$t=c=>typeof c=="function",le=(c,h,a)=>{for(const l in a){const m="set"+jr(l);c[m]?bo(()=>a[l],(y,g)=>{c[m](y,g)}):h[m]&&bo(()=>a[l],y=>{h[m](y)})}},ue=(c,h,a={})=>{const l={...a};for(const m in c){const y=h[m],g=c[m];y&&(y&&y.custom===!0||g!==void 0&&(l[m]=g))}return l},we=c=>{const h={},a={};for(const l in c)if(l.startsWith("on")&&!l.startsWith("onUpdate")&&l!=="onReady"){const m=l.slice(2).toLocaleLowerCase();h[m]=c[l]}else a[l]=c[l];return{listeners:h,attrs:a}},Ur=async c=>{const h=await Promise.all([Mt(()=>import("./marker-icon-2x-e148f0f7.js"),[]),Mt(()=>import("./marker-icon-d6994ad0.js"),[]),Mt(()=>import("./marker-shadow-a7f70f89.js"),[])]);delete c.Default.prototype._getIconUrl,c.Default.mergeOptions({iconRetinaUrl:h[0].default,iconUrl:h[1].default,shadowUrl:h[2].default})},fi=c=>{const h=G((...l)=>console.warn(`Method ${c} has been invoked without being replaced`)),a=(...l)=>h.value(...l);return a.wrapped=h,Ft(c,a),a},_i=(c,h)=>c.wrapped.value=h,Wt=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||globalThis,zt=c=>{const h=se(c);if(h===void 0)throw new Error(`Attempt to inject ${c.description} before it was provided.`);return h},he=Symbol("useGlobalLeaflet"),He=Symbol("addLayer"),Oo=Symbol("removeLayer"),Ao=Symbol("registerControl"),Gr=Symbol("registerLayerControl"),Eo=Symbol("canSetParentHtml"),Io=Symbol("setParentHtml"),Bo=Symbol("setIcon"),qr=Symbol("bindPopup"),Zo=Symbol("bindTooltip"),Kr=Symbol("unbindPopup"),Ro=Symbol("unbindTooltip"),We={options:{type:Object,default:()=>({}),custom:!0}},je=c=>({options:c.options,methods:{}}),be={...We,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},Do=(c,h,a)=>{const l=zt(He),m=zt(Oo),{options:y,methods:g}=je(c),x=ue(c,be,y),v=()=>l({leafletObject:h.value}),M=()=>m({leafletObject:h.value}),P={...g,setAttribution(S){M(),h.value.options.attribution=S,c.visible&&v()},setName(){M(),c.visible&&v()},setLayerType(){M(),c.visible&&v()},setVisible(S){h.value&&(S?v():M())},bindPopup(S){if(!h.value||!$t(h.value.bindPopup)){console.warn("Attempt to bind popup before bindPopup method available on layer.");return}h.value.bindPopup(S)},bindTooltip(S){if(!h.value||!$t(h.value.bindTooltip)){console.warn("Attempt to bind tooltip before bindTooltip method available on layer.");return}h.value.bindTooltip(S)},unbindTooltip(){h.value&&($t(h.value.closeTooltip)&&h.value.closeTooltip(),$t(h.value.unbindTooltip)&&h.value.unbindTooltip())},unbindPopup(){h.value&&($t(h.value.closePopup)&&h.value.closePopup(),$t(h.value.unbindPopup)&&h.value.unbindPopup())},updateVisibleProp(S){a.emit("update:visible",S)}};return Ft(qr,P.bindPopup),Ft(Zo,P.bindTooltip),Ft(Kr,P.unbindPopup),Ft(Ro,P.unbindTooltip),an(()=>{P.unbindPopup(),P.unbindTooltip(),M()}),{options:x,methods:P}},$r=(c,h)=>{if(c&&h.default)return ae("div",{style:{display:"none"}},h.default())},Yr={...be,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},No={...Yr,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},Jr={...No,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}};({...Jr});const Le={...We,position:{type:String}},Xr=(c,h)=>{const{options:a,methods:l}=je(c),m=ue(c,Le,a),y={...l,setPosition(g){h.value&&h.value.setPosition(g)}};return an(()=>{h.value&&h.value.remove()}),{options:m,methods:y}},Qr=c=>c.default?ae("div",{ref:"root"},c.default()):null;oe({name:"LControl",props:{...Le,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(c,h){const a=G(),l=G(),m=se(he),y=zt(Ao),{options:g,methods:x}=Xr(c,a);return re(async()=>{const{Control:v,DomEvent:M}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]),P=v.extend({onAdd(){return l.value}});a.value=xe(new P(g)),le(x,a.value,c),y({leafletObject:a.value}),c.disableClickPropagation&&l.value&&M.disableClickPropagation(l.value),c.disableScrollPropagation&&l.value&&M.disableScrollPropagation(l.value),Jt(()=>h.emit("ready",a.value))}),{root:l,leafletObject:a}},render(){return Qr(this.$slots)}});({...Le});({...Le});({...Le});({...Le});const Vo={...be};({...Vo});({...Vo});const ln={...be,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number},className:{type:String}},Fo=(c,h,a)=>{const{options:l,methods:m}=Do(c,h,a),y=ue(c,ln,l),g={...m,setTileComponent(){var x;(x=h.value)==null||x.redraw()}};return an(()=>{h.value.off()}),{options:y,methods:g}},ta=(c,h,a,l)=>c.extend({initialize(m){this.tileComponents={},this.on("tileunload",this._unloadTile),a.setOptions(this,m)},createTile(m){const y=this._tileCoordsToKey(m);this.tileComponents[y]=h.create("div");const g=ae({setup:l,props:["coords"]},{coords:m});return wr(g,this.tileComponents[y]),this.tileComponents[y]},_unloadTile(m){const y=this._tileCoordsToKey(m.coords);this.tileComponents[y]&&(this.tileComponents[y].innerHTML="",this.tileComponents[y]=void 0)}});oe({props:{...ln,childRender:{type:Function,required:!0}},setup(c,h){const a=G(),l=G(null),m=G(!1),y=se(he),g=zt(He),{options:x,methods:v}=Fo(c,a,h);return re(async()=>{const{GridLayer:M,DomUtil:P,Util:S}=y?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]),q=ta(M,P,S,c.childRender);a.value=xe(new q(x));const{listeners:H}=we(h.attrs);a.value.on(H),le(v,a.value,c),g({...c,...v,leafletObject:a.value}),m.value=!0,Jt(()=>h.emit("ready",a.value))}),{root:l,ready:m,leafletObject:a}},render(){return this.ready?ae("div",{style:{display:"none"},ref:"root"}):null}});const Po={iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}};oe({name:"LIcon",props:{...Po,...We},setup(c,h){const a=G(),l=se(he),m=zt(Eo),y=zt(Io),g=zt(Bo);let x,v,M,P,S;const q=(xt,X,rt)=>{const K=xt&&xt.innerHTML;if(!X){rt&&S&&m()&&y(K);return}const{listeners:kt}=we(h.attrs);S&&v(S,kt);const{options:jt}=je(c),mt=ue(c,Po,jt);K&&(mt.html=K),S=mt.html?M(mt):P(mt),x(S,kt),g(S)},H=()=>{Jt(()=>q(a.value,!0,!1))},lt=()=>{Jt(()=>q(a.value,!1,!0))},N={setIconUrl:H,setIconRetinaUrl:H,setIconSize:H,setIconAnchor:H,setPopupAnchor:H,setTooltipAnchor:H,setShadowUrl:H,setShadowRetinaUrl:H,setShadowAnchor:H,setBgPos:H,setClassName:H,setHtml:H};return re(async()=>{const{DomEvent:xt,divIcon:X,icon:rt}=l?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);x=xt.on,v=xt.off,M=X,P=rt,le(N,{},c),new MutationObserver(lt).observe(a.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),H()}),{root:a}},render(){const c=this.$slots.default?this.$slots.default():void 0;return ae("div",{ref:"root"},c)}});({...be});function Ho(c,h,a){var l,m,y;h===void 0&&(h=50),a===void 0&&(a={});var g=(l=a.isImmediate)!=null&&l,x=(m=a.callback)!=null&&m,v=a.maxWait,M=Date.now(),P=[];function S(){if(v!==void 0){var H=Date.now()-M;if(H+h>=v)return v-H}return h}var q=function(){var H=[].slice.call(arguments),lt=this;return new Promise(function(N,xt){var X=g&&y===void 0;if(y!==void 0&&clearTimeout(y),y=setTimeout(function(){if(y=void 0,M=Date.now(),!g){var K=c.apply(lt,H);x&&x(K),P.forEach(function(kt){return(0,kt.resolve)(K)}),P=[]}},S()),X){var rt=c.apply(lt,H);return x&&x(rt),N(rt)}P.push({resolve:N,reject:xt})})};return q.cancel=function(H){y!==void 0&&clearTimeout(y),P.forEach(function(lt){return(0,lt.reject)(H)}),P=[]},q}const To={...We,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},ea=oe({inheritAttrs:!1,emits:["ready","update:zoom","update:center","update:bounds"],props:To,setup(c,h){const a=G(),l=xr({ready:!1,layersToAdd:[],layersInControl:[]}),{options:m}=je(c),y=ue(c,To,m),{listeners:g,attrs:x}=we(h.attrs),v=fi(He),M=fi(Oo),P=fi(Ao),S=fi(Gr);Ft(he,c.useGlobalLeaflet);const q=ci(()=>{const X={};return c.noBlockingAnimations&&(X.animate=!1),X}),H=ci(()=>{const X=q.value;return c.padding&&(X.padding=c.padding),c.paddingTopLeft&&(X.paddingTopLeft=c.paddingTopLeft),c.paddingBottomRight&&(X.paddingBottomRight=c.paddingBottomRight),X}),lt={moveend:Ho(X=>{l.leafletRef&&(h.emit("update:zoom",l.leafletRef.getZoom()),h.emit("update:center",l.leafletRef.getCenter()),h.emit("update:bounds",l.leafletRef.getBounds()))}),overlayadd(X){const rt=l.layersInControl.find(K=>K.name===X.name);rt&&rt.updateVisibleProp(!0)},overlayremove(X){const rt=l.layersInControl.find(K=>K.name===X.name);rt&&rt.updateVisibleProp(!1)}};re(async()=>{c.useGlobalLeaflet&&(Wt.L=Wt.L||await Mt(()=>Promise.resolve().then(()=>ga),void 0));const{map:X,CRS:rt,Icon:K,latLngBounds:kt,latLng:jt,stamp:mt}=c.useGlobalLeaflet?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);try{y.beforeMapMount&&await y.beforeMapMount()}catch(I){console.error(`The following error occurred running the provided beforeMapMount hook ${I.message}`)}await Ur(K);const Ue=typeof y.crs=="string"?rt[y.crs]:y.crs;y.crs=Ue||rt.EPSG3857;const Ut={addLayer(I){I.layerType!==void 0&&(l.layerControl===void 0?l.layersToAdd.push(I):l.layersInControl.find($=>mt($.leafletObject)===mt(I.leafletObject))||(l.layerControl.addLayer(I),l.layersInControl.push(I))),I.visible!==!1&&l.leafletRef.addLayer(I.leafletObject)},removeLayer(I){I.layerType!==void 0&&(l.layerControl===void 0?l.layersToAdd=l.layersToAdd.filter($=>$.name!==I.name):(l.layerControl.removeLayer(I.leafletObject),l.layersInControl=l.layersInControl.filter($=>mt($.leafletObject)!==mt(I.leafletObject)))),l.leafletRef.removeLayer(I.leafletObject)},registerLayerControl(I){l.layerControl=I,l.layersToAdd.forEach($=>{l.layerControl.addLayer($)}),l.layersToAdd=[],P(I)},registerControl(I){l.leafletRef.addControl(I.leafletObject)},setZoom(I){const $=l.leafletRef.getZoom();I!==$&&l.leafletRef.setZoom(I,q.value)},setCrs(I){const $=l.leafletRef.getBounds();l.leafletRef.options.crs=I,l.leafletRef.fitBounds($,{animate:!1,padding:[0,0]})},fitBounds(I){l.leafletRef.fitBounds(I,H.value)},setBounds(I){if(!I)return;const $=kt(I);$.isValid()&&!(l.lastSetBounds||l.leafletRef.getBounds()).equals($,0)&&(l.lastSetBounds=$,l.leafletRef.fitBounds($))},setCenter(I){if(I==null)return;const $=jt(I),ut=l.lastSetCenter||l.leafletRef.getCenter();(ut.lat!==$.lat||ut.lng!==$.lng)&&(l.lastSetCenter=$,l.leafletRef.panTo($,q.value))}};_i(v,Ut.addLayer),_i(M,Ut.removeLayer),_i(P,Ut.registerControl),_i(S,Ut.registerLayerControl),l.leafletRef=xe(X(a.value,y)),le(Ut,l.leafletRef,c),Lo(l.leafletRef,lt),Lo(l.leafletRef,g),l.ready=!0,Jt(()=>h.emit("ready",l.leafletRef))}),rn(()=>{ko(lt),l.leafletRef&&(l.leafletRef.off(),l.leafletRef.remove())});const N=ci(()=>l.leafletRef),xt=ci(()=>l.ready);return{root:a,ready:xt,leafletObject:N,attrs:x}},render({attrs:c}){return c.style||(c.style={}),c.style.width||(c.style.width="100%"),c.style.height||(c.style.height="100%"),ae("div",{...c,ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),ia=["Symbol(Comment)","Symbol(Text)"],na=["LTooltip","LPopup"],Wo={...be,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},oa=(c,h,a)=>{const{options:l,methods:m}=Do(c,h,a),y=ue(c,Wo,l),g={...m,setDraggable(x){h.value.dragging&&(x?h.value.dragging.enable():h.value.dragging.disable())},latLngSync(x){a.emit("update:latLng",x.latlng),a.emit("update:lat-lng",x.latlng)},setLatLng(x){if(x!=null&&h.value){const v=h.value.getLatLng();(!v||!v.equals(x))&&h.value.setLatLng(x)}}};return{options:y,methods:g}},sa=(c,h)=>{const a=h.slots.default&&h.slots.default();return a&&a.length&&a.some(ra)};function ra(c){return!(ia.includes(c.type.toString())||na.includes(c.type.name))}const aa=oe({name:"LMarker",props:Wo,setup(c,h){const a=G(),l=G(!1),m=se(he),y=zt(He);Ft(Eo,()=>{var M;return!!((M=a.value)!=null&&M.getElement())}),Ft(Io,M=>{var P,S;const q=$t((P=a.value)==null?void 0:P.getElement)&&((S=a.value)==null?void 0:S.getElement());q&&(q.innerHTML=M)}),Ft(Bo,M=>{var P;return((P=a.value)==null?void 0:P.setIcon)&&a.value.setIcon(M)});const{options:g,methods:x}=oa(c,a,h),v={moveHandler:Ho(x.latLngSync)};return re(async()=>{const{marker:M,divIcon:P}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);sa(g,h)&&(g.icon=P({className:""})),a.value=xe(M(c.latLng,g));const{listeners:S}=we(h.attrs);a.value.on(S),a.value.on("move",v.moveHandler),le(x,a.value,c),y({...c,...x,leafletObject:a.value}),l.value=!0,Jt(()=>h.emit("ready",a.value))}),rn(()=>ko(v)),{ready:l,leafletObject:a}},render(){return $r(this.ready,this.$slots)}}),la={...No,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},So={...la},jo={...We,content:{type:String,default:null}},ua=(c,h)=>{const{options:a,methods:l}=je(c),m={...l,setContent(y){h.value&&y!==null&&y!==void 0&&h.value.setContent(y)}};return{options:a,methods:m}},ha=c=>c.default?ae("div",{ref:"root"},c.default()):null;({...jo});({...So,latLngs:{...So.latLngs}});const un={...ln,tms:{type:Boolean,default:void 0},subdomains:{type:[String,Array],validator:c=>typeof c=="string"?!0:Array.isArray(c)?c.every(h=>typeof h=="string"):!1},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}},ca=(c,h,a)=>{const{options:l,methods:m}=Fo(c,h,a),y=ue(c,un,l),g={...m};return{options:y,methods:g}},da=oe({props:un,setup(c,h){const a=G(),l=se(he),m=zt(He),{options:y,methods:g}=ca(c,a,h);return re(async()=>{const{tileLayer:x}=l?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);a.value=xe(x(c.url,y));const{listeners:v}=we(h.attrs);a.value.on(v),le(g,a.value,c),m({...c,...g,leafletObject:a.value}),Jt(()=>h.emit("ready",a.value))}),{leafletObject:a}},render(){return null}}),fa={...jo},_a=(c,h)=>{const{options:a,methods:l}=ua(c,h),m=zt(Ro);return rn(()=>{m()}),{options:a,methods:l}},pa=oe({name:"LTooltip",props:fa,setup(c,h){const a=G(),l=G(null),m=se(he),y=zt(Zo),{options:g,methods:x}=_a(c,a);return re(async()=>{const{tooltip:v}=m?Wt.L:await Mt(()=>import("./leaflet-src.esm-9c358b30.js"),[]);a.value=xe(v(g)),le(x,a.value,c);const{listeners:M}=we(h.attrs);a.value.on(M),a.value.setContent(c.content||l.value||""),y(a.value),Jt(()=>h.emit("ready",a.value))}),{root:l,leafletObject:a}},render(){return ha(this.$slots)}});({...un});var nn={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(c,h){(function(a,l){l(h)})(br,function(a){var l="1.9.4";function m(t){var e,i,n,o;for(i=1,n=arguments.length;i"u"||!L||!L.Mixin)){t=K(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(z(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=hn(this.x),this.y=hn(this.y),this},distanceTo:function(t){t=z(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=z(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+q(this.x)+", "+q(this.y)+")"}};function z(t,e,i){return t instanceof k?t:K(t)?new k(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function Y(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=ft(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=ft(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=et(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=et(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,rs=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",S,e),window.removeEventListener("testPassiveEventSupport",S,e)}catch{}return t}(),as=function(){return!!document.createElement("canvas").getContext}(),Li=!!(document.createElementNS&&dn("svg").createSVGRect),ls=!!Li&&function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),us=!Li&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),hs=navigator.platform.indexOf("Mac")===0,cs=navigator.platform.indexOf("Linux")===0;function Ot(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var b={ie:Ge,ielt9:Ko,edge:_n,webkit:xi,android:pn,android23:mn,androidStock:Yo,opera:wi,chrome:gn,gecko:vn,safari:Jo,phantom:yn,opera12:xn,win:Xo,ie3d:wn,webkit3d:bi,gecko3d:bn,any3d:Qo,mobile:Se,mobileWebkit:ts,mobileWebkit3d:es,msPointer:Ln,pointer:Pn,touch:is,touchNative:Tn,mobileOpera:ns,mobileGecko:os,retina:ss,passiveEvents:rs,canvas:as,svg:Li,vml:us,inlineSvg:ls,mac:hs,linux:cs},Sn=b.msPointer?"MSPointerDown":"pointerdown",Cn=b.msPointer?"MSPointerMove":"pointermove",Mn=b.msPointer?"MSPointerUp":"pointerup",zn=b.msPointer?"MSPointerCancel":"pointercancel",Pi={touchstart:Sn,touchmove:Cn,touchend:Mn,touchcancel:zn},kn={touchstart:gs,touchmove:qe,touchend:qe,touchcancel:qe},ce={},On=!1;function ds(t,e,i){return e==="touchstart"&&ms(),kn[e]?(i=kn[e].bind(this,i),t.addEventListener(Pi[e],i,!1),i):(console.warn("wrong event specified:",e),S)}function fs(t,e,i){if(!Pi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(Pi[e],i,!1)}function _s(t){ce[t.pointerId]=t}function ps(t){ce[t.pointerId]&&(ce[t.pointerId]=t)}function An(t){delete ce[t.pointerId]}function ms(){On||(document.addEventListener(Sn,_s,!0),document.addEventListener(Cn,ps,!0),document.addEventListener(Mn,An,!0),document.addEventListener(zn,An,!0),On=!0)}function qe(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in ce)e.touches.push(ce[i]);e.changedTouches=[e],t(e)}}function gs(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ht(e),qe(t,e)}function vs(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var ys=200;function xs(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(s){if(s.detail!==1){n=s.detail;return}if(!(s.pointerType==="mouse"||s.sourceCapabilities&&!s.sourceCapabilities.firesTouchEvents)){var r=Rn(s);if(!(r.some(function(_){return _ instanceof HTMLLabelElement&&_.attributes.for})&&!r.some(function(_){return _ instanceof HTMLInputElement||_ instanceof HTMLSelectElement}))){var u=Date.now();u-i<=ys?(n++,n===2&&e(vs(s))):n=1,i=u}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function ws(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var Ti=Ye(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ce=Ye(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),En=Ce==="webkitTransition"||Ce==="OTransition"?Ce+"End":"transitionend";function In(t){return typeof t=="string"?document.getElementById(t):t}function Me(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function D(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function J(t){var e=t.parentNode;e&&e.removeChild(t)}function Ke(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Si(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=$e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function A(t,e){if(t.classList!==void 0)for(var i=lt(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function Nn(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Ps:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Di(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var Ts={__proto__:null,on:O,off:U,stopPropagation:ee,disableScrollPropagation:Ri,disableClickPropagation:Ae,preventDefault:ht,stop:ie,getPropagationPath:Rn,getMousePosition:Dn,getWheelDelta:Nn,isExternalTarget:Di,addListener:O,removeListener:U},Vn=Pe.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=te(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ut(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,et(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=z(e.paddingTopLeft||e.padding||[0,0]),n=z(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),u=ft([r.min.add(i),r.max.subtract(n)]),_=u.getSize();if(!u.contains(s)){this._enforcingBounds=!0;var p=s.subtract(u.getCenter()),w=u.extend(s).getSize().subtract(_);o.x+=p.x<0?-w.x:w.x,o.y+=p.y<0?-w.y:w.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=m({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return!s.x&&!s.y?this:(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(g(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=m({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=g(this._handleGeolocationResponse,this),i=g(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new W(e,i),o=n.toBounds(t.coords.accuracy*2),s=this._locateOptions;if(s.setView){var r=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(r,s.maxZoom):r)}var u={latlng:n,bounds:o,timestamp:t.timestamp};for(var _ in t.coords)typeof t.coords[_]=="number"&&(u[_]=t.coords[_]);this.fire("locationfound",u)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),J(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(wt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)J(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=D("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new _t(e,i)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=et(t),i=z(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),u=t.getSouthEast(),_=this.getSize().subtract(i),p=ft(this.project(u,n),this.project(r,n)).getSize(),w=b.any3d?this.options.zoomSnap:1,C=_.x/p.x,E=_.y/p.y,ct=e?Math.max(C,E):Math.min(C,E);return n=this.getScaleZoom(ct,n),w&&(n=Math.round(n/(w/100))*(w/100),n=e?Math.ceil(n/w)*w:Math.floor(n/w)*w),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Y(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(B(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(z(t),e)},layerPointToLatLng:function(t){var e=z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(B(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(B(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(et(t))},distance:function(t,e){return this.options.crs.distance(B(t),B(e))},containerPointToLayerPoint:function(t){return z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(B(t)))},mouseEventToContainerPoint:function(t){return Dn(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=In(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");O(e,"scroll",this._onScroll,this),this._containerId=v(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&b.any3d,A(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Me(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),it(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(A(t.markerPane,"leaflet-zoom-hide"),A(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){it(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return wt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){it(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[v(this._container)]=this;var e=t?U:O;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){wt(this._resizeRequest),this._resizeRequest=ut(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",s=t.target||t.srcElement,r=!1;s;){if(n=this._targets[v(s)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){r=!0;break}if(n&&n.listens(e,!0)&&(o&&!Di(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!r&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&Ai(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=m({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],r=0;r0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Q(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=D("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=Ti,n=this._proxy.style[i];Qt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){J(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Qt(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(ut(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,A(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(g(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Q(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ss(t,e){return new Z(t,e)}var Tt=Bt.extend({options:{position:"topright"},initialize:function(t){N(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return A(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(J(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ee=function(t){return new Tt(t)};Z.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=D("div",e+"control-container",this._container);function n(o,s){var r=e+o+" "+e+s;t[o+s]=D("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)J(this._controlCorners[t]);J(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Fn=Tt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(v(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+v(this),i),this._layerControlInputs.push(n),n.layerId=v(t.layer),O(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");e.appendChild(s),s.appendChild(n),s.appendChild(o);var r=t.overlay?this._overlaysList:this._baseLayersList;return r.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,i,n=[],o=[];this._handlingClick=!0;for(var s=t.length-1;s>=0;s--)e=t[s],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(s=0;s=0;o--)e=t[o],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,O(t,"click",ht),this.expand();var e=this;setTimeout(function(){U(t,"click",ht),e._preventClick=!1})}}),Cs=function(t,e,i){return new Fn(t,e,i)},Ni=Tt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=D("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=D("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ae(s),O(s,"click",ie),O(s,"click",o,this),O(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";Q(this._zoomInButton,e),Q(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(A(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(A(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Z.mergeOptions({zoomControl:!0}),Z.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ni,this.addControl(this.zoomControl))});var Ms=function(t){return new Ni(t)},Hn=Tt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=D("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=D("div",e,i)),t.imperial&&(this._iScale=D("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,o;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),zs=function(t){return new Hn(t)},ks='',Vi=Tt.extend({options:{position:"bottomright",prefix:''+(b.inlineSvg?ks+" ":"")+"Leaflet"},initialize:function(t){N(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=D("div","leaflet-control-attribution"),Ae(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});Z.mergeOptions({attributionControl:!0}),Z.addInitHook(function(){this.options.attributionControl&&new Vi().addTo(this)});var Os=function(t){return new Vi(t)};Tt.Layers=Fn,Tt.Zoom=Ni,Tt.Scale=Hn,Tt.Attribution=Vi,Ee.layers=Cs,Ee.zoom=Ms,Ee.scale=zs,Ee.attribution=Os;var Et=Bt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Et.addTo=function(t,e){return t.addHandler(e,this),this};var As={Events:gt},Wn=b.touch?"touchstart mousedown":"mousedown",qt=Pe.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){N(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(O(this._dragStartTarget,Wn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(qt._dragging===this&&this.finishDrag(!0),U(this._dragStartTarget,Wn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Si(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){qt._dragging===this&&this.finishDrag();return}if(!(qt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(qt._dragging=this,this._preventOutline&&Ai(this._element),zi(),ze(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Bn(this._element);this._startPoint=new k(e.clientX,e.clientY),this._startPos=te(this._element),this._parentScale=Ei(i);var n=t.type==="mousedown";O(document,n?"mousemove":"touchmove",this._onMove,this),O(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new k(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)s&&(r=u,s=_);s>i&&(e[r]=1,Hi(t,e,i,n,r),Hi(t,e,i,r,o))}function Zs(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Rs(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ie(t,e,i,n){var o=e.x,s=e.y,r=i.x-o,u=i.y-s,_=r*r+u*u,p;return _>0&&(p=((t.x-o)*r+(t.y-s)*u)/_,p>1?(o=i.x,s=i.y):p>0&&(o+=r*p,s+=u*p)),r=t.x-o,u=t.y-s,n?r*r+u*u:new k(o,s)}function Lt(t){return!K(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Yn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Lt(t)}function Jn(t,e){var i,n,o,s,r,u,_,p;if(!t||t.length===0)throw new Error("latlngs not passed");Lt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var w=B([0,0]),C=et(t),E=C.getNorthWest().distanceTo(C.getSouthWest())*C.getNorthEast().distanceTo(C.getNorthWest());E<1700&&(w=Fi(t));var ct=t.length,at=[];for(i=0;in){_=(s-n)/o,p=[u.x-_*(u.x-r.x),u.y-_*(u.y-r.y)];break}var pt=e.unproject(z(p));return B([pt.lat+w.lat,pt.lng+w.lng])}var Ds={__proto__:null,simplify:Gn,pointToSegmentDistance:qn,closestPointOnSegment:Is,clipSegment:$n,_getEdgeIntersection:Qe,_getBitCode:ne,_sqClosestPointOnSegment:Ie,isFlat:Lt,_flat:Yn,polylineCenter:Jn},Wi={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new W(t.y,t.x)},bounds:new Y([-180,-90],[180,90])},ji={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Y([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),u=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(u,1e-10)),new k(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),s=Math.exp(-t.y/i),r=Math.PI/2-2*Math.atan(s),u=0,_=.1,p;u<15&&Math.abs(_)>1e-7;u++)p=o*Math.sin(r),p=Math.pow((1-p)/(1+p),o/2),_=Math.PI/2-2*Math.atan(s*p)-r,r+=_;return new W(r*e,t.x*e/i)}},Ns={__proto__:null,LonLat:Wi,Mercator:ji,SphericalMercator:mi},Vs=m({},Gt,{code:"EPSG:3395",projection:ji,transformation:function(){var t=.5/(Math.PI*ji.R);return Te(t,.5,-t,.5)}()}),Xn=m({},Gt,{code:"EPSG:4326",projection:Wi,transformation:Te(1/180,1,-1/180,.5)}),Fs=m({},Zt,{projection:Wi,transformation:Te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});Zt.Earth=Gt,Zt.EPSG3395=Vs,Zt.EPSG3857=vi,Zt.EPSG900913=qo,Zt.EPSG4326=Xn,Zt.Simple=Fs;var St=Pe.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[v(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[v(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});Z.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=v(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=v(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return v(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?K(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof W&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Dt.prototype._setLatLngs.call(this,t),Lt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Lt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new k(e,e);if(t=new Y(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,o=this._rings.length,s;nt.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||Dt.prototype._containsPoint.call(this,t,!0)}});function $s(t,e){return new me(t,e)}var Nt=Rt.extend({initialize:function(t,e){N(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=K(t)?t:t.features,i,n,o;if(e){for(i=0,n=e.length;i0&&o.push(o[0].slice()),o}function ge(t,e){return t.feature?m({},t.feature,{geometry:e}):si(e)}function si(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Ki={toGeoJSON:function(t){return ge(this,{type:"Point",coordinates:qi(this.getLatLng(),t)})}};ti.include(Ki),Ui.include(Ki),ei.include(Ki),Dt.include({toGeoJSON:function(t){var e=!Lt(this._latlngs),i=oi(this._latlngs,e?1:0,!1,t);return ge(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),me.include({toGeoJSON:function(t){var e=!Lt(this._latlngs),i=e&&!Lt(this._latlngs[0]),n=oi(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),ge(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),_e.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),ge(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var s=o.toGeoJSON(t);if(i)n.push(s.geometry);else{var r=si(s);r.type==="FeatureCollection"?n.push.apply(n,r.features):n.push(r)}}}),i?ge(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function eo(t,e){return new Nt(t,e)}var Ys=eo,ri=St.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=et(e),N(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(A(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){J(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=et(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:D("img");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=S,e.onmousemove=S,e.onload=g(this.fire,this,"load"),e.onerror=g(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Qt(this._image,i,e)},_reset:function(){var t=this._image,e=new Y(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();it(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){bt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Js=function(t,e,i){return new ri(t,e,i)},io=ri.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:D("video");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=S,e.onmousemove=S,e.onloadeddata=g(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o0?n:[e.src];return}K(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;so?(e.height=o+"px",A(t,s)):Q(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();it(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(Me(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new k(this._containerLeft,-i-this._containerBottom);o._add(te(this._container));var s=t.layerPointToContainerPoint(o),r=z(this.options.autoPanPadding),u=z(this.options.autoPanPaddingTopLeft||r),_=z(this.options.autoPanPaddingBottomRight||r),p=t.getSize(),w=0,C=0;s.x+n+_.x>p.x&&(w=s.x+n-p.x+_.x),s.x-w-u.x<0&&(w=s.x-u.x),s.y+i+_.y>p.y&&(C=s.y+i-p.y+_.y),s.y-C-u.y<0&&(C=s.y-u.y),(w||C)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([w,C]))}},_getAnchor:function(){return z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),tr=function(t,e){return new ai(t,e)};Z.mergeOptions({closePopupOnClick:!0}),Z.include({openPopup:function(t,e,i){return this._initOverlay(ai,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),St.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ai,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Rt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){ie(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Kt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var li=It.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){It.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){It.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=It.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=D("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+v(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),u=this.options.direction,_=o.offsetWidth,p=o.offsetHeight,w=z(this.options.offset),C=this._getAnchor();u==="top"?(e=_/2,i=p):u==="bottom"?(e=_/2,i=0):u==="center"?(e=_/2,i=p/2):u==="right"?(e=0,i=p/2):u==="left"?(e=_,i=p/2):r.xthis.options.maxZoom||in?this._retainParent(o,s,r,n):!1)},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new k(o,s);r.z=i+1;var u=this._tileCoordsToKey(r),_=this._tiles[u];if(_&&_.active){_.retain=!0;continue}else _&&_.loaded&&(_.retain=!0);i+1this.options.maxZoom||this.options.minZoom!==void 0&&o1){this._setView(t,i);return}for(var C=o.min.y;C<=o.max.y;C++)for(var E=o.min.x;E<=o.max.x;E++){var ct=new k(E,C);if(ct.z=this._tileZoom,!!this._isValidTile(ct)){var at=this._tiles[this._tileCoordsToKey(ct)];at?at.current=!0:r.push(ct)}}if(r.sort(function(pt,ye){return pt.distanceTo(s)-ye.distanceTo(s)}),r.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Pt=document.createDocumentFragment();for(E=0;Ei.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return et(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),r=e.unproject(o,t.z);return[s,r]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new _t(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new k(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(J(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){A(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=S,t.onmousemove=S,b.ielt9&&this.options.opacity<1&&bt(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),g(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&ut(g(this._tileReady,this,t,null,o)),it(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(bt(i.el,0),wt(this._fadeFrame),this._fadeFrame=ut(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(A(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?ut(this._pruneTiles,this):setTimeout(g(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new k(this._wrapX?P(t.x,this._wrapX):t.x,this._wrapY?P(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Y(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function nr(t){return new Ze(t)}var ve=Ze.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=N(this,e),e.detectRetina&&b.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return O(i,"load",g(this._tileOnLoad,this,e,i)),O(i,"error",g(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return rt(this._url,m(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(g(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=S,e.onerror=S,!e.complete)){e.src=jt;var i=this._tiles[t].coords;J(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",jt),Ze.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===jt))return Ze.prototype._tileReady.call(this,t,e,i)}});function so(t,e){return new ve(t,e)}var ro=ve.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=m({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=N(this,e);var o=e.detectRetina&&b.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ve.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=ft(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Xn?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),u=ve.prototype.getTileUrl.call(this,t);return u+xt(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return m(this.wmsParams,t),e||this.redraw(),this}});function or(t,e){return new ro(t,e)}ve.WMS=ro,so.wms=or;var Vt=St.extend({options:{padding:.1},initialize:function(t){N(this,t),v(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),A(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?Qt(this._container,s,i):it(this._container,s)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Y(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ao=Vt.extend({options:{tolerance:0},getEvents:function(){var t=Vt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Vt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");O(t,"mousemove",this._onMouseMove,this),O(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),O(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){wt(this._redrawRequest),delete this._ctx,J(this._container),U(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Vt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1;it(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Vt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[v(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[v(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,o;for(o=0;o')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),sr={_initContainer:function(){this._container=D("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Vt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Re("shape");A(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Re("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[v(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;J(e),t.removeInteractiveTarget(e),delete this._layers[v(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Re("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=K(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Re("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},ui=b.vml?Re:dn,De=Vt.extend({_initContainer:function(){this._container=ui("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ui("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){J(this._container),U(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Vt.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),it(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=ui("path");t.options.className&&A(e,t.options.className),t.options.interactive&&A(e,"leaflet-interactive"),this._updateStyle(t),this._layers[v(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){J(t._path),t.removeInteractiveTarget(t._path),delete this._layers[v(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,fn(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,o="a"+i+","+n+" 0 1,0 ",s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+i*2+",0 "+o+-i*2+",0 ";this._setPath(t,s)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});b.vml&&De.include(sr);function uo(t){return b.svg||b.vml?new De(t):null}Z.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&lo(t)||uo(t)}});var ho=me.extend({initialize:function(t,e){me.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=et(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function rr(t,e){return new ho(t,e)}De.create=ui,De.pointsToPath=fn,Nt.geometryToLayer=ii,Nt.coordsToLatLng=Gi,Nt.coordsToLatLngs=ni,Nt.latLngToCoords=qi,Nt.latLngsToCoords=oi,Nt.getFeature=ge,Nt.asFeature=si,Z.mergeOptions({boxZoom:!0});var co=Et.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){O(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){U(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){J(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ze(),zi(),this._startPoint=this._map.mouseEventToContainerPoint(t),O(document,{contextmenu:ie,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=D("div","leaflet-zoom-box",this._container),A(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Y(this._point,this._startPoint),i=e.getSize();it(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(J(this._box),Q(this._container,"leaflet-crosshair")),ke(),ki(),U(document,{contextmenu:ie,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(g(this._resetState,this),0);var e=new _t(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Z.addInitHook("addHandler","boxZoom",co),Z.mergeOptions({doubleClickZoom:!0});var fo=Et.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});Z.addInitHook("addHandler","doubleClickZoom",fo),Z.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var _o=Et.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new qt(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}A(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Q(this._map._container,"leaflet-grab"),Q(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=et(this._map.options.maxBounds);this._offsetLimit=ft(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});Z.addInitHook("addHandler","scrollWheelZoom",mo);var ar=600;Z.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15});var go=Et.extend({addHooks:function(){O(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){U(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new k(e.clientX,e.clientY),this._holdTimeout=setTimeout(g(function(){this._cancel(),this._isTapValid()&&(O(document,"touchend",ht),O(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),ar),O(document,"touchend touchcancel contextmenu",this._cancel,this),O(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){U(document,"touchend",ht),U(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),U(document,"touchend touchcancel contextmenu",this._cancel,this),U(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new k(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});Z.addInitHook("addHandler","tapHold",go),Z.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0});var vo=Et.extend({addHooks:function(){A(this._map._container,"leaflet-touch-zoom"),O(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Q(this._map._container,"leaflet-touch-zoom"),U(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),O(document,"touchmove",this._onTouchMove,this),O(document,"touchend touchcancel",this._onTouchEnd,this),ht(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(o===1&&s.x===0&&s.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),wt(this._animRequest);var r=g(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ut(r,this,!0),ht(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,wt(this._animRequest),U(document,"touchmove",this._onTouchMove,this),U(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Z.addInitHook("addHandler","touchZoom",vo),Z.BoxZoom=co,Z.DoubleClickZoom=fo,Z.Drag=_o,Z.Keyboard=po,Z.ScrollWheelZoom=mo,Z.TapHold=go,Z.TouchZoom=vo,a.Bounds=Y,a.Browser=b,a.CRS=Zt,a.Canvas=ao,a.Circle=Ui,a.CircleMarker=ei,a.Class=Bt,a.Control=Tt,a.DivIcon=oo,a.DivOverlay=It,a.DomEvent=Ts,a.DomUtil=Ls,a.Draggable=qt,a.Evented=Pe,a.FeatureGroup=Rt,a.GeoJSON=Nt,a.GridLayer=Ze,a.Handler=Et,a.Icon=pe,a.ImageOverlay=ri,a.LatLng=W,a.LatLngBounds=_t,a.Layer=St,a.LayerGroup=_e,a.LineUtil=Ds,a.Map=Z,a.Marker=ti,a.Mixin=As,a.Path=Kt,a.Point=k,a.PolyUtil=Es,a.Polygon=me,a.Polyline=Dt,a.Popup=ai,a.PosAnimation=Vn,a.Projection=Ns,a.Rectangle=ho,a.Renderer=Vt,a.SVG=De,a.SVGOverlay=no,a.TileLayer=ve,a.Tooltip=li,a.Transformation=gi,a.Util=Uo,a.VideoOverlay=io,a.bind=g,a.bounds=ft,a.canvas=lo,a.circle=qs,a.circleMarker=Gs,a.control=Ee,a.divIcon=ir,a.extend=m,a.featureGroup=Ws,a.geoJSON=eo,a.geoJson=Ys,a.gridLayer=nr,a.icon=js,a.imageOverlay=Js,a.latLng=B,a.latLngBounds=et,a.layerGroup=Hs,a.map=Ss,a.marker=Us,a.point=z,a.polygon=$s,a.polyline=Ks,a.popup=tr,a.rectangle=rr,a.setOptions=N,a.stamp=v,a.svg=uo,a.svgOverlay=Qs,a.tileLayer=so,a.tooltip=er,a.transformation=Te,a.version=l,a.videoOverlay=Xs;var lr=window.L;a.noConflict=function(){return window.L=lr,this},window.L=a})})(nn,nn.exports);var Fe=nn.exports;const ma=Lr(Fe),ga=Ir({__proto__:null,default:ma},[Fe]);const va={components:{LMap:ea,LTileLayer:da,LMarker:aa,LTooltip:pa,L:Fe.L,icon:Fe.icon},setup(){const c=l=>`${pi}media/map_icons/${l}.png`,h={icon_cod:{iconUrl:c("fns"),iconSize:[30,30],iconAnchor:[16,40]},icon_metro:{iconUrl:c("mos_metro"),iconSize:[30,25],iconAnchor:[10,20]},icon_mcd:{iconUrl:c("mcd_d2"),iconSize:[32,18],iconAnchor:[10,20]},icon_bus:{iconUrl:c("bus"),iconSize:[18,18],iconAnchor:[1,1]}},a=G([{coordinate:[55.83451,37.40848],icon:h.icon_cod,tooltip:"МИ ФНС России по ЦОД №2",tooltip_bus:""},{coordinate:[55.83309,37.39933],icon:h.icon_mcd,tooltip:'МЦД D2: пл."Трикотажная"',tooltip_bus:""},{coordinate:[55.82741,37.43715],icon:h.icon_metro,tooltip:'Ст.метро: "Тушинская"',tooltip_bus:""},{coordinate:[55.82705,37.4411],icon:h.icon_mcd,tooltip:'МЦД D2: пл. "Тушинская"',tooltip_bus:""},{coordinate:[55.8496,37.43925],icon:h.icon_metro,tooltip:'Ст.метро: "Сходненская"',tooltip_bus:""},{coordinate:[55.835274,37.411052],icon:h.icon_bus,tooltip:'Остановка: "Налоговый городок"',tooltip_bus:"Автобусы:№368, №с377"},{coordinate:[55.833193,37.400858],icon:h.icon_bus,tooltip:'Остановка:"МЦД Трикотажная"',tooltip_bus:"Автобусы: №26, №368, №с377, №с396"},{coordinate:[55.82524,37.43575],icon:h.icon_bus,tooltip:'Остановка: "метро Тушинская", выход:5 ',tooltip_bus:"Автобусы: №400, №741, №741к, №856, №436, №575"},{coordinate:[55.8501,37.43905],icon:h.icon_bus,tooltip:'Остановка: "метро Сходненская", выход:9',tooltip_bus:"Автобус: №368"},{coordinate:[55.83607,37.40569],icon:h.icon_bus,tooltip:'Остановка "Храм Сергия Радонежского"',tooltip_bus:"Автобусы: №88, №488, №с377, №с396"},{coordinate:[55.83132,37.4034],icon:h.icon_bus,tooltip:'Остановка "МЦД Трикотажная"',tooltip_bus:"Автобусы: №2, №210, №400Т, №741, №741к, №856, №436, №575"}]);return{icons:h,markers:a,icon:Fe.icon,address:{building:"125373, Москва, Походный проезд, двл.3, стр 1",phone:"Телефон: 8(495) 198-53-12"},address_pathes:[{title_path:"От станции МЦД «Трикотажная»,",path:'на автобусе 368, до остановки "Налоговый городок" или пешком (10 минут) до территории Налоговго городка'},{title_path:"От станции метро «Сходненская», выход:9,",path:" 1-й вагон из центра, далее на автобусе № 368"},{title_path:"От станции МЦД «Тушинская»,",path:" проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка"},{title_path:"От станции метро «Тушинская», выход:5,",path:" последний вагон из центра, автобусы №2, №210, №400Т, №741, №741к, №856, №436, №575 до остановки «пл. Трикотажная» или от станции МЦД «Тушинская» проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка"},{title_path:"От остановки автобуса «Храм Сергия Радонежского»",path:" и далее пешком (10 минут) до территории Налоговго городка"}],work_times:[{day:"Понедельник - Четверг",time:"09:00 - 18:00"},{day:"Пятница",time:"09:00 - 16:45"},{day:"Суббота - Воскресенье",time:"Выходной"}],baseURL:pi}}},ya={style:{"max-width":"20%","min-width":"20%","word-wrap":"break-word"}};function xa(c,h,a,l,m,y){const g=vt("l-tile-layer"),x=vt("l-tooltip"),v=vt("l-marker"),M=vt("l-map");return V(),ot(R,{"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{lg:"5",md:"12",sm:"12",xs:"12",class:"flex-column d-flex"},{default:f(()=>[d(st,{elevation:"5",class:"h-100","min-height":"250"},{default:f(()=>[d(M,{zoom:14,"min-zoom":14,center:l.markers[0].coordinate},{default:f(()=>[d(g,{url:`${l.baseURL}media/Tiles/{z}/{x}/{y}.png`},null,8,["url"]),(V(!0),Ct(Ht,null,Yt(l.markers,P=>(V(),ot(v,{key:P,"lat-lng":P.coordinate,icon:l.icon(P.icon)},{default:f(()=>[d(x,null,{default:f(()=>[j("p",null,tt(P.tooltip),1),j("p",ya,tt(P.tooltip_bus),1)]),_:2},1024)]),_:2},1032,["lat-lng","icon"]))),128))]),_:1},8,["center"])]),_:1})]),_:1}),d(T,{class:"flex-column"},{default:f(()=>[d(R,{"no-gutters":"",class:"h-100 gap flex-column"},{default:f(()=>[d(T,{lg:"3",class:"w100 flex-column"},{default:f(()=>[d(st,{class:"h-100 flex-column d-flex",elevation:"5"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[d(R,null,{default:f(()=>[d(T,{lg:"5",class:"d-flex justify-center"},{default:f(()=>[F("Адрес")]),_:1}),d(T,{lg:"6",class:"d-flex justify-center"},{default:f(()=>[F("Время работы")]),_:1})]),_:1})]),_:1}),d(R,{class:"d-flex justify-center align-center"},{default:f(()=>[d(T,{lg:"4"},{default:f(()=>[d(yt,{class:"text-subtitle-1"},{default:f(()=>[F(tt(l.address.building),1)]),_:1}),d(yt,{class:"text-subtitle-1"},{default:f(()=>[F(tt(l.address.phone),1)]),_:1})]),_:1}),d(T,{lg:"7"},{default:f(()=>[d(en,null,{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.work_times,P=>(V(),ot(Xi,{key:P},{default:f(()=>[d(R,null,{default:f(()=>[d(T,{lg:"6",class:"text-subtitle-1 d-flex justify-center align-center"},{default:f(()=>[F(tt(P.day),1)]),_:2},1024),d(T,{lg:"6",class:"text-subtitle-1 d-flex justify-center align-center"},{default:f(()=>[F(tt(P.time),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),d(T,null,{default:f(()=>[d(st,{class:"h-100 flex-column d-flex",elevation:"5"},{default:f(()=>[d(dt,{class:"text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Способ проезда ")]),_:1}),d(yt,{class:"text-subtitle-1"},{default:f(()=>[d(en,{lines:"three"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.address_pathes,P=>(V(),ot(Xi,{key:P},{default:f(()=>[j("strong",null,tt(P.title_path),1),F(tt(P.path),1)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const wa=Xt(va,[["render",xa]]),ba={props:{title:{type:String,default:""},size:{type:Object,default:()=>{}}}},La=j("span",{class:"text-subtitle-1 text-grey"},"Данных нет",-1);function Pa(c,h,a,l,m,y){const g=vt("vue3-autocounter");return V(),ot(st,{class:"flex-grow-1 d-flex flex-column"},{default:f(()=>[d(dt,{class:"text-h6 text-center text-uppercase"},{default:f(()=>[F(tt(a.title),1)]),_:1}),Object.keys(a.size).length>0?(V(),Ct(Ht,{key:0},[d(st,{class:"h-100 flex-column d-flex align-center justify-center text-center elevation-0"},{default:f(()=>[d(g,{class:"text-h2 font-weight-regular pb-2",ref:"counter",startAmount:0,endAmount:a.size.size,duration:2},null,8,["endAmount"])]),_:1}),d(Qi,{class:"text-center"},{default:f(()=>[F("по состоянию на "+tt(new Date(a.size.date_created).toLocaleDateString("ru-RU")),1)]),_:1})],64)):(V(),ot(st,{key:1,class:"h-100 d-flex align-center justify-center text-center"},{default:f(()=>[La]),_:1}))]),_:1})}const Ta=Xt(ba,[["render",Pa]]),Sa={components:{GeneralInformationSize:Ta},setup(){const{lgAndUp:c}=Co(),h=G([]),a=G({factsize:0,date_created:new Date}),l=G({statesize:0,date_created:new Date}),m=G([]),y=()=>{Ne.get("api/accounts/getuser/?userlogin=9966-00-001").then(M=>{h.value=M.data})},g=()=>{Ne.get("api/about_inspection/getfactsize/").then(M=>{a.value=M.data})},x=()=>{Ne.get("api/about_inspection/getstatesize/").then(M=>{l.value=M.data})};return(()=>{Ne.get("api/about_inspection/getinspectiondirections/").then(M=>{m.value=M.data})})(),x(),g(),y(),{userlinks:h,checkremote:on,directionworks:m,getstatesize:l,getfactsize:a,spravURL:sn,baseURL:pi,lgAndUp:c,date_now:new Date().toLocaleDateString("ru-RU"),caCuratorLink:G("https://www.nalog.gov.ru/rn77/about_fts/fts/structure_fts/ca_fns/9515034/")}}},Ca=j("p",{class:"font-weight-medium text-lg-subtitle-1 text-sm-caption"}," создана 01.02.2018 года в соответствии с приказом ФНС России от 27.12.2017 №ММВ-7-4/1102 ",-1),Ma={class:"mt-3"},za=["href"],ka=j("p",null," Государственный советник Российской Федерации 2 класса ",-1);function Oa(c,h,a,l,m,y){const g=vt("general-information-size");return V(),ot(R,{"no-gutters":"",class:"flex-column h-100 gap"},{default:f(()=>[d(T,null,{default:f(()=>[d(R,{"no-gutters":"",class:"flex-column h-100 gap"},{default:f(()=>[d(T,{class:"w100 flex-grow-0"},{default:f(()=>[d(st,{class:"text-center"},{default:f(()=>[d(yt,{class:"font-weight-medium text-lg-h6"},{default:f(()=>[F(" Межрегиональная инспекция Федеральной налоговой службы по централизованной обработке данных №2 "),Ca,j("p",Ma,[j("a",{class:"text-decoration-none",href:l.caCuratorLink},"Работа МИ ФНС России по ЦОД №2 координируется заместителем руководителя ФНС России Будариным Андреем Владимировичем",8,za)])]),_:1})]),_:1})]),_:1}),d(T,{class:"d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,{lg:"3",class:"flex-column"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap flex-column h-100"},{default:f(()=>[d(T,{class:"w100"},{default:f(()=>[d(st,{class:"h-100"},{default:f(()=>[d(dt,{class:"text-h6 text-uppercase text-center"},{default:f(()=>[F(" Начальник инспекции")]),_:1}),d(tn,{class:"mb-3"}),d(Pr,{src:l.checkremote(`${l.spravURL}${l.userlinks.login}.jpg`),height:"200"},null,8,["src"]),d(dt,{class:"text-h6 text-center"},{default:f(()=>[F(tt(l.userlinks.fio),1)]),_:1}),d(yt,{class:"text-center text-body-2"},{default:f(()=>[ka]),_:1})]),_:1})]),_:1}),d(T,{class:"w100 flex-column d-flex"},{default:f(()=>[d(g,{size:l.getfactsize,title:"Фактическая численнность"},null,8,["size"])]),_:1}),d(T,{class:"w100 flex-column d-flex"},{default:f(()=>[d(g,{size:l.getstatesize,title:"Штатная численность"},null,8,["size"])]),_:1})]),_:1})]),_:1}),d(T,null,{default:f(()=>[d(st,{class:"h-100 flex-column d-flex"},{default:f(()=>[d(dt,{class:"text-h6 text-uppercase text-center"},{default:f(()=>[F(" Основные направления деятельности инспекции ")]),_:1}),d(tn,{class:"pb-3"}),d(R,{"no-gutters":"",class:Ji(["gap",l.lgAndUp?"h-0 overflow-auto":""])},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.directionworks,x=>(V(),ot(T,{class:"px-3 py-2 flex-grow-0",key:x.id},{default:f(()=>[d(st,{class:"d-flex",elevation:3},{default:f(()=>[d(T,{class:"d-flex align-center v-col-auto"},{default:f(()=>[d(Tr,{class:"elevation-10 text-teal-darken-4",color:"teal-lighten-5"},{default:f(()=>[d(Ve,{icon:x.icon_name},null,8,["icon"])]),_:2},1024)]),_:2},1024),d(T,{class:"d-flex align-center justify-start text-h6"},{default:f(()=>[F(tt(x.direction_title),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["class"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Aa=Xt(Sa,[["render",Oa]]),Ea={props:{idVacations:{type:Number,default:-1}},setup(c){const h=G({fio:"",email:"",tel:"",text:""}),a=Sr().alert,l=v=>!!v||"Поле обязательно",m={fio:[v=>l(v),v=>v.match(/^[а-яА-ЯЁё ]+$/)!==null||"Имя должно содержать русские буквы"],email:[v=>l(v)],tel:[v=>l(v),v=>v.match(/^[[\d-]*\d[\d-]*$/)!==null||"Номер должен содержать цифры"],text:""},y=G(null),g=G(null);return{form:h,file:y,rules:m,submit:()=>{if(g.value.isValid){const v=new FormData;v.append("data",JSON.stringify({...h.value,vacancy_id:c.idVacations})),y.value!==null&&v.append("file",y.value[0]),zo.post("api/about_inspection/postresponsevacancy/",v).then(M=>{a.alert=!0,a.text=M.data,a.color="teal-lighten-4",a.ico="mdi-email-outline"})}},form_vacancies:g}}},Ia=j("span",{class:"text-h4"},"Откликнуться на вакансию",-1);function Ba(c,h,a,l,m,y){return V(),Ct("div",null,[d(yt,{class:"text-center"},{default:f(()=>[Ia]),_:1}),d(yt,{class:"d-flex flex-column pt-0"},{default:f(()=>[d(Or,{ref:"form_vacancies",onSubmit:Cr(l.submit,["prevent"])},{default:f(()=>[d(R,{"no-gutters":"",class:"justify-center"},{default:f(()=>[d(T,{lg:"8"},{default:f(()=>[d(Yi,{modelValue:l.form.fio,"onUpdate:modelValue":h[0]||(h[0]=g=>l.form.fio=g),counter:10,rules:l.rules.fio,label:"Фамилия, имя, отчество"},null,8,["modelValue","rules"]),d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,null,{default:f(()=>[d(Yi,{modelValue:l.form.email,"onUpdate:modelValue":h[1]||(h[1]=g=>l.form.email=g),rules:l.rules.email,label:"E-mail или почта Lotus"},null,8,["modelValue","rules"])]),_:1}),d(T,null,{default:f(()=>[d(Yi,{modelValue:l.form.tel,"onUpdate:modelValue":h[2]||(h[2]=g=>l.form.tel=g),counter:7,rules:l.rules.tel,label:"Телефон"},null,8,["modelValue","rules"])]),_:1})]),_:1}),d(Ar,{modelValue:l.form.text,"onUpdate:modelValue":h[3]||(h[3]=g=>l.form.text=g),"no-resize":"",rows:"4",label:"Сопроводительное письмо"},null,8,["modelValue"]),d(Er,{label:"Резюме","hide-details":"",modelValue:l.file,"onUpdate:modelValue":h[4]||(h[4]=g=>l.file=g)},null,8,["modelValue"]),d(Mo,{block:"",type:"submit",class:"mt-4 text-none",color:"btn_text"},{default:f(()=>[F(" Отправить ")]),_:1})]),_:1})]),_:1})]),_:1},8,["onSubmit"])]),_:1})])}const Za=Xt(Ea,[["render",Ba]]);const Ra={components:{ResponseVacancies:Za},setup(){const c=Mr();let h=G({name:"",department:{name:""}}),a=G(-1),l=G({});const m=()=>{zo.get("api/about_inspection/getvacancy/").then(x=>{l.value=x.data,h.value=l.value[0],a.value=l.value[0].id})},y=x=>x.replaceAll('src="/media/uploads',`src="${pi}media/uploads`),g=x=>{a.value!=x?(a.value=x,h.value=l.value.find(v=>v.id==x)):(a.value=-1,h.value={name:"",department:{name:""}})};return m(),{vacancy:l,formatText:y,vacancyDescription:h,getIndVacation:g,vacancySelect:a,goTo:c}}},Da={class:"text-h4 text-wrap"},Na={class:"text-h5"},Va=j("span",{class:"text-h6"}," Направление деятельности подразделения ",-1),Fa=j("span",{class:"text-h6"}," Функционал и должностные обязанности ",-1),Ha=["innerHTML"],Wa=j("span",{class:"text-h6"}," Базовые требования к соискателю ",-1),ja=["innerHTML"],Ua=j("br",null,null,-1),Ga=j("span",{class:"text-h5 text-grey"},[F("Для подробного описания вакансии "),j("br"),F(" выберите её из списка слева")],-1),qa=j("br",null,null,-1),Ka=j("span",{class:"text-h5 text-grey"},[F("Сейчас вакансий нет, "),j("br"),F(" загляните позжет")],-1);function $a(c,h,a,l,m,y){const g=vt("response-vacancies");return l.vacancy.length>0?(V(),ot(R,{key:0,"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{lg:"4",class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex flex-column rounded-0"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Вакансии ")]),_:1}),d(R,{"no-gutters":"",class:"h-0 gap overflow-auto"},{default:f(()=>[d(T,null,{default:f(()=>[d(st,{class:"mx-auto h-100"},{default:f(()=>[d(en,{density:"compact",class:"px-0"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.vacancy,x=>(V(),ot(Xi,{key:x.id,value:x,class:"border-b-sm","active-class":"custom-active",color:"teal-darken-3",onClick:v=>l.getIndVacation(x.id)},{default:f(()=>[d(st,{class:"rounded-0 bg-transparent"},{default:f(()=>[d(dt,{class:"text-wrap"},{default:f(()=>[F(tt(x.name),1)]),_:2},1024),d(yt,{class:"pb-2"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,null,{default:f(()=>[F(tt(x.department.name),1)]),_:2},1024),d(T,{class:"flex-grow-0 text-subtitle-1 text-btn_text"},{default:f(()=>[F(" Подробнее ")]),_:1}),d(T,{class:"flex-grow-0 align-self-center pl-2"},{default:f(()=>[d(Ve,{icon:"mdi-arrow-right",color:"btn_text",size:"small"})]),_:1})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),d(T,{class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex flex-column rounded-0"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Описание ")]),_:1}),d(R,{"no-gutters":"",class:"h-0 gap overflow-auto",id:"goto-container-example"},{default:f(()=>[d(T,null,{default:f(()=>[l.vacancyDescription.name!=""?(V(),ot(st,{key:0,class:"rounded-0 h-100"},{default:f(()=>[d(dt,{class:"mt-4"},{default:f(()=>[j("span",Da,tt(l.vacancyDescription.name),1)]),_:1}),d(dt,{class:"pt-0"},{default:f(()=>[j("span",Na,tt(l.vacancyDescription.department.name),1)]),_:1}),d(dt,null,{default:f(()=>[d(Mo,{type:"submit",class:"text-subtitle-1 font-weight-light",color:"btn_text",elevation:"1",onClick:h[0]||(h[0]=x=>l.goTo("#response",{container:"#goto-container-example"}))},{default:f(()=>[F(" Откликнуться ")]),_:1})]),_:1}),d(dt,{class:"pt-6"},{default:f(()=>[Va]),_:1}),d(yt,{class:"mx-5 my-1"},{default:f(()=>[j("ul",null,[(V(!0),Ct(Ht,null,Yt(l.vacancyDescription.department.department_directions,x=>(V(),Ct("li",{class:"py-1",key:x},tt(x.direction_title),1))),128))])]),_:1}),d(dt,null,{default:f(()=>[Fa]),_:1}),d(yt,{class:"mx-5 my-0 ckeditor_ul"},{default:f(()=>[j("div",{class:"py-1",innerHTML:l.vacancyDescription.functional},null,8,Ha)]),_:1}),d(dt,null,{default:f(()=>[Wa]),_:1}),d(yt,{class:"mx-5 my-0 ckeditor_ul"},{default:f(()=>[j("div",{class:"py-1",innerHTML:l.vacancyDescription.requirements},null,8,ja)]),_:1}),d(tn),d(g,{id:"response",idVacations:l.vacancySelect},null,8,["idVacations"])]),_:1})):(V(),ot(st,{key:1,class:"h-100 pa-1 d-flex align-center justify-center text-center"},{default:f(()=>[d(Qi,null,{default:f(()=>[d(Ve,{icon:"mdi-format-list-bulleted",color:"grey",size:"x-large"}),Ua,Ga]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(V(),ot(R,{key:1,"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex align-center justify-center text-center"},{default:f(()=>[d(Qi,null,{default:f(()=>[d(Ve,{icon:"mdi-credit-card-off",size:"x-large",color:"grey"}),qa,Ka]),_:1})]),_:1})]),_:1})]),_:1}))}const Ya=Xt(Ra,[["render",$a]]);const Ja={components:{StructureInspection:Wr,ContactInfo:wa,PatternTabs:kr,GeneralInformation:Aa,OpenVacancies:Ya},setup(){return zr(),{tabs_items:[{title:"Общая информация",value:"mainInfo"},{title:"Структура инспекции",value:"structureInspection"},{title:"Открытые вакансии",value:"openVacancies"},{title:"Контактная информация",value:"contactInfo"}]}}};function Xa(c,h,a,l,m,y){const g=vt("general-information"),x=vt("structure-inspection"),v=vt("open-vacancies"),M=vt("contact-info"),P=vt("pattern-tabs");return V(),ot(P,{tabs:l.tabs_items},{item:f(()=>[d(di,{class:"gap h-100",value:"mainInfo"},{default:f(()=>[d(g)]),_:1}),d(di,{class:"gap h-100",value:"structureInspection"},{default:f(()=>[d(x)]),_:1}),d(di,{class:"gap h-100",value:"openVacancies"},{default:f(()=>[d(v)]),_:1}),d(di,{class:"gap h-100",value:"contactInfo"},{default:f(()=>[d(M)]),_:1})]),_:1},8,["tabs"])}const cl=Xt(Ja,[["render",Xa]]);export{cl as default}; + */(function(c,h){(function(a,l){l(h)})(br,function(a){var l="1.9.4";function m(t){var e,i,n,o;for(i=1,n=arguments.length;i"u"||!L||!L.Mixin)){t=K(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(z(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=hn(this.x),this.y=hn(this.y),this},distanceTo:function(t){t=z(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=z(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+q(this.x)+", "+q(this.y)+")"}};function z(t,e,i){return t instanceof k?t:K(t)?new k(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function Y(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=ft(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=ft(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=et(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=et(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,rs=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",S,e),window.removeEventListener("testPassiveEventSupport",S,e)}catch{}return t}(),as=function(){return!!document.createElement("canvas").getContext}(),Li=!!(document.createElementNS&&dn("svg").createSVGRect),ls=!!Li&&function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),us=!Li&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),hs=navigator.platform.indexOf("Mac")===0,cs=navigator.platform.indexOf("Linux")===0;function Ot(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var b={ie:Ge,ielt9:Ko,edge:_n,webkit:xi,android:pn,android23:mn,androidStock:Yo,opera:wi,chrome:gn,gecko:vn,safari:Jo,phantom:yn,opera12:xn,win:Xo,ie3d:wn,webkit3d:bi,gecko3d:bn,any3d:Qo,mobile:Se,mobileWebkit:ts,mobileWebkit3d:es,msPointer:Ln,pointer:Pn,touch:is,touchNative:Tn,mobileOpera:ns,mobileGecko:os,retina:ss,passiveEvents:rs,canvas:as,svg:Li,vml:us,inlineSvg:ls,mac:hs,linux:cs},Sn=b.msPointer?"MSPointerDown":"pointerdown",Cn=b.msPointer?"MSPointerMove":"pointermove",Mn=b.msPointer?"MSPointerUp":"pointerup",zn=b.msPointer?"MSPointerCancel":"pointercancel",Pi={touchstart:Sn,touchmove:Cn,touchend:Mn,touchcancel:zn},kn={touchstart:gs,touchmove:qe,touchend:qe,touchcancel:qe},ce={},On=!1;function ds(t,e,i){return e==="touchstart"&&ms(),kn[e]?(i=kn[e].bind(this,i),t.addEventListener(Pi[e],i,!1),i):(console.warn("wrong event specified:",e),S)}function fs(t,e,i){if(!Pi[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(Pi[e],i,!1)}function _s(t){ce[t.pointerId]=t}function ps(t){ce[t.pointerId]&&(ce[t.pointerId]=t)}function An(t){delete ce[t.pointerId]}function ms(){On||(document.addEventListener(Sn,_s,!0),document.addEventListener(Cn,ps,!0),document.addEventListener(Mn,An,!0),document.addEventListener(zn,An,!0),On=!0)}function qe(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in ce)e.touches.push(ce[i]);e.changedTouches=[e],t(e)}}function gs(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ht(e),qe(t,e)}function vs(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var ys=200;function xs(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(s){if(s.detail!==1){n=s.detail;return}if(!(s.pointerType==="mouse"||s.sourceCapabilities&&!s.sourceCapabilities.firesTouchEvents)){var r=Rn(s);if(!(r.some(function(_){return _ instanceof HTMLLabelElement&&_.attributes.for})&&!r.some(function(_){return _ instanceof HTMLInputElement||_ instanceof HTMLSelectElement}))){var u=Date.now();u-i<=ys?(n++,n===2&&e(vs(s))):n=1,i=u}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function ws(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var Ti=Ye(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ce=Ye(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),En=Ce==="webkitTransition"||Ce==="OTransition"?Ce+"End":"transitionend";function In(t){return typeof t=="string"?document.getElementById(t):t}function Me(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function D(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function J(t){var e=t.parentNode;e&&e.removeChild(t)}function Ke(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Si(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=$e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function A(t,e){if(t.classList!==void 0)for(var i=lt(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function Nn(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Ps:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Di(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var Ts={__proto__:null,on:O,off:U,stopPropagation:ee,disableScrollPropagation:Ri,disableClickPropagation:Ae,preventDefault:ht,stop:ie,getPropagationPath:Rn,getMousePosition:Dn,getWheelDelta:Nn,isExternalTarget:Di,addListener:O,removeListener:U},Vn=Pe.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=te(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ut(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,et(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=z(e.paddingTopLeft||e.padding||[0,0]),n=z(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),u=ft([r.min.add(i),r.max.subtract(n)]),_=u.getSize();if(!u.contains(s)){this._enforcingBounds=!0;var p=s.subtract(u.getCenter()),w=u.extend(s).getSize().subtract(_);o.x+=p.x<0?-w.x:w.x,o.y+=p.y<0?-w.y:w.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=m({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return!s.x&&!s.y?this:(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(g(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=m({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=g(this._handleGeolocationResponse,this),i=g(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new W(e,i),o=n.toBounds(t.coords.accuracy*2),s=this._locateOptions;if(s.setView){var r=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(r,s.maxZoom):r)}var u={latlng:n,bounds:o,timestamp:t.timestamp};for(var _ in t.coords)typeof t.coords[_]=="number"&&(u[_]=t.coords[_]);this.fire("locationfound",u)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),J(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(wt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)J(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=D("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new _t(e,i)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=et(t),i=z(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),u=t.getSouthEast(),_=this.getSize().subtract(i),p=ft(this.project(u,n),this.project(r,n)).getSize(),w=b.any3d?this.options.zoomSnap:1,C=_.x/p.x,E=_.y/p.y,ct=e?Math.max(C,E):Math.min(C,E);return n=this.getScaleZoom(ct,n),w&&(n=Math.round(n/(w/100))*(w/100),n=e?Math.ceil(n/w)*w:Math.floor(n/w)*w),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Y(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(B(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(z(t),e)},layerPointToLatLng:function(t){var e=z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(B(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(B(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(et(t))},distance:function(t,e){return this.options.crs.distance(B(t),B(e))},containerPointToLayerPoint:function(t){return z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(B(t)))},mouseEventToContainerPoint:function(t){return Dn(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=In(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");O(e,"scroll",this._onScroll,this),this._containerId=v(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&b.any3d,A(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Me(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),it(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(A(t.markerPane,"leaflet-zoom-hide"),A(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){it(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return wt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){it(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[v(this._container)]=this;var e=t?U:O;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){wt(this._resizeRequest),this._resizeRequest=ut(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",s=t.target||t.srcElement,r=!1;s;){if(n=this._targets[v(s)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){r=!0;break}if(n&&n.listens(e,!0)&&(o&&!Di(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!r&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&Ai(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=m({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],r=0;r0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Q(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=D("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=Ti,n=this._proxy.style[i];Qt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){J(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Qt(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(ut(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,A(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(g(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Q(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ss(t,e){return new Z(t,e)}var Tt=Bt.extend({options:{position:"topright"},initialize:function(t){N(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return A(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(J(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ee=function(t){return new Tt(t)};Z.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=D("div",e+"control-container",this._container);function n(o,s){var r=e+o+" "+e+s;t[o+s]=D("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)J(this._controlCorners[t]);J(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Fn=Tt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(v(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+v(this),i),this._layerControlInputs.push(n),n.layerId=v(t.layer),O(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");e.appendChild(s),s.appendChild(n),s.appendChild(o);var r=t.overlay?this._overlaysList:this._baseLayersList;return r.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,i,n=[],o=[];this._handlingClick=!0;for(var s=t.length-1;s>=0;s--)e=t[s],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(s=0;s=0;o--)e=t[o],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,O(t,"click",ht),this.expand();var e=this;setTimeout(function(){U(t,"click",ht),e._preventClick=!1})}}),Cs=function(t,e,i){return new Fn(t,e,i)},Ni=Tt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=D("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=D("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ae(s),O(s,"click",ie),O(s,"click",o,this),O(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";Q(this._zoomInButton,e),Q(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(A(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(A(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Z.mergeOptions({zoomControl:!0}),Z.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ni,this.addControl(this.zoomControl))});var Ms=function(t){return new Ni(t)},Hn=Tt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=D("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=D("div",e,i)),t.imperial&&(this._iScale=D("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,o;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),zs=function(t){return new Hn(t)},ks='',Vi=Tt.extend({options:{position:"bottomright",prefix:''+(b.inlineSvg?ks+" ":"")+"Leaflet"},initialize:function(t){N(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=D("div","leaflet-control-attribution"),Ae(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});Z.mergeOptions({attributionControl:!0}),Z.addInitHook(function(){this.options.attributionControl&&new Vi().addTo(this)});var Os=function(t){return new Vi(t)};Tt.Layers=Fn,Tt.Zoom=Ni,Tt.Scale=Hn,Tt.Attribution=Vi,Ee.layers=Cs,Ee.zoom=Ms,Ee.scale=zs,Ee.attribution=Os;var Et=Bt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Et.addTo=function(t,e){return t.addHandler(e,this),this};var As={Events:gt},Wn=b.touch?"touchstart mousedown":"mousedown",qt=Pe.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){N(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(O(this._dragStartTarget,Wn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(qt._dragging===this&&this.finishDrag(!0),U(this._dragStartTarget,Wn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Si(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){qt._dragging===this&&this.finishDrag();return}if(!(qt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(qt._dragging=this,this._preventOutline&&Ai(this._element),zi(),ze(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Bn(this._element);this._startPoint=new k(e.clientX,e.clientY),this._startPos=te(this._element),this._parentScale=Ei(i);var n=t.type==="mousedown";O(document,n?"mousemove":"touchmove",this._onMove,this),O(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new k(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)s&&(r=u,s=_);s>i&&(e[r]=1,Hi(t,e,i,n,r),Hi(t,e,i,r,o))}function Zs(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Rs(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ie(t,e,i,n){var o=e.x,s=e.y,r=i.x-o,u=i.y-s,_=r*r+u*u,p;return _>0&&(p=((t.x-o)*r+(t.y-s)*u)/_,p>1?(o=i.x,s=i.y):p>0&&(o+=r*p,s+=u*p)),r=t.x-o,u=t.y-s,n?r*r+u*u:new k(o,s)}function Lt(t){return!K(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Yn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Lt(t)}function Jn(t,e){var i,n,o,s,r,u,_,p;if(!t||t.length===0)throw new Error("latlngs not passed");Lt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var w=B([0,0]),C=et(t),E=C.getNorthWest().distanceTo(C.getSouthWest())*C.getNorthEast().distanceTo(C.getNorthWest());E<1700&&(w=Fi(t));var ct=t.length,at=[];for(i=0;in){_=(s-n)/o,p=[u.x-_*(u.x-r.x),u.y-_*(u.y-r.y)];break}var pt=e.unproject(z(p));return B([pt.lat+w.lat,pt.lng+w.lng])}var Ds={__proto__:null,simplify:Gn,pointToSegmentDistance:qn,closestPointOnSegment:Is,clipSegment:$n,_getEdgeIntersection:Qe,_getBitCode:ne,_sqClosestPointOnSegment:Ie,isFlat:Lt,_flat:Yn,polylineCenter:Jn},Wi={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new W(t.y,t.x)},bounds:new Y([-180,-90],[180,90])},ji={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Y([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),u=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(u,1e-10)),new k(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),s=Math.exp(-t.y/i),r=Math.PI/2-2*Math.atan(s),u=0,_=.1,p;u<15&&Math.abs(_)>1e-7;u++)p=o*Math.sin(r),p=Math.pow((1-p)/(1+p),o/2),_=Math.PI/2-2*Math.atan(s*p)-r,r+=_;return new W(r*e,t.x*e/i)}},Ns={__proto__:null,LonLat:Wi,Mercator:ji,SphericalMercator:mi},Vs=m({},Gt,{code:"EPSG:3395",projection:ji,transformation:function(){var t=.5/(Math.PI*ji.R);return Te(t,.5,-t,.5)}()}),Xn=m({},Gt,{code:"EPSG:4326",projection:Wi,transformation:Te(1/180,1,-1/180,.5)}),Fs=m({},Zt,{projection:Wi,transformation:Te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});Zt.Earth=Gt,Zt.EPSG3395=Vs,Zt.EPSG3857=vi,Zt.EPSG900913=qo,Zt.EPSG4326=Xn,Zt.Simple=Fs;var St=Pe.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[v(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[v(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});Z.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=v(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=v(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return v(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?K(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof W&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Dt.prototype._setLatLngs.call(this,t),Lt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Lt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new k(e,e);if(t=new Y(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,o=this._rings.length,s;nt.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||Dt.prototype._containsPoint.call(this,t,!0)}});function $s(t,e){return new me(t,e)}var Nt=Rt.extend({initialize:function(t,e){N(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=K(t)?t:t.features,i,n,o;if(e){for(i=0,n=e.length;i0&&o.push(o[0].slice()),o}function ge(t,e){return t.feature?m({},t.feature,{geometry:e}):si(e)}function si(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Ki={toGeoJSON:function(t){return ge(this,{type:"Point",coordinates:qi(this.getLatLng(),t)})}};ti.include(Ki),Ui.include(Ki),ei.include(Ki),Dt.include({toGeoJSON:function(t){var e=!Lt(this._latlngs),i=oi(this._latlngs,e?1:0,!1,t);return ge(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),me.include({toGeoJSON:function(t){var e=!Lt(this._latlngs),i=e&&!Lt(this._latlngs[0]),n=oi(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),ge(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),_e.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),ge(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var s=o.toGeoJSON(t);if(i)n.push(s.geometry);else{var r=si(s);r.type==="FeatureCollection"?n.push.apply(n,r.features):n.push(r)}}}),i?ge(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function eo(t,e){return new Nt(t,e)}var Ys=eo,ri=St.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=et(e),N(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(A(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){J(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=et(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:D("img");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=S,e.onmousemove=S,e.onload=g(this.fire,this,"load"),e.onerror=g(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Qt(this._image,i,e)},_reset:function(){var t=this._image,e=new Y(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();it(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){bt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Js=function(t,e,i){return new ri(t,e,i)},io=ri.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:D("video");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=S,e.onmousemove=S,e.onloadeddata=g(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o0?n:[e.src];return}K(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;so?(e.height=o+"px",A(t,s)):Q(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();it(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(Me(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new k(this._containerLeft,-i-this._containerBottom);o._add(te(this._container));var s=t.layerPointToContainerPoint(o),r=z(this.options.autoPanPadding),u=z(this.options.autoPanPaddingTopLeft||r),_=z(this.options.autoPanPaddingBottomRight||r),p=t.getSize(),w=0,C=0;s.x+n+_.x>p.x&&(w=s.x+n-p.x+_.x),s.x-w-u.x<0&&(w=s.x-u.x),s.y+i+_.y>p.y&&(C=s.y+i-p.y+_.y),s.y-C-u.y<0&&(C=s.y-u.y),(w||C)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([w,C]))}},_getAnchor:function(){return z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),tr=function(t,e){return new ai(t,e)};Z.mergeOptions({closePopupOnClick:!0}),Z.include({openPopup:function(t,e,i){return this._initOverlay(ai,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),St.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ai,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Rt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){ie(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Kt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var li=It.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){It.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){It.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=It.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=D("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+v(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),u=this.options.direction,_=o.offsetWidth,p=o.offsetHeight,w=z(this.options.offset),C=this._getAnchor();u==="top"?(e=_/2,i=p):u==="bottom"?(e=_/2,i=0):u==="center"?(e=_/2,i=p/2):u==="right"?(e=0,i=p/2):u==="left"?(e=_,i=p/2):r.xthis.options.maxZoom||in?this._retainParent(o,s,r,n):!1)},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new k(o,s);r.z=i+1;var u=this._tileCoordsToKey(r),_=this._tiles[u];if(_&&_.active){_.retain=!0;continue}else _&&_.loaded&&(_.retain=!0);i+1this.options.maxZoom||this.options.minZoom!==void 0&&o1){this._setView(t,i);return}for(var C=o.min.y;C<=o.max.y;C++)for(var E=o.min.x;E<=o.max.x;E++){var ct=new k(E,C);if(ct.z=this._tileZoom,!!this._isValidTile(ct)){var at=this._tiles[this._tileCoordsToKey(ct)];at?at.current=!0:r.push(ct)}}if(r.sort(function(pt,ye){return pt.distanceTo(s)-ye.distanceTo(s)}),r.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Pt=document.createDocumentFragment();for(E=0;Ei.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return et(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),r=e.unproject(o,t.z);return[s,r]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new _t(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new k(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(J(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){A(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=S,t.onmousemove=S,b.ielt9&&this.options.opacity<1&&bt(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),g(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&ut(g(this._tileReady,this,t,null,o)),it(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(bt(i.el,0),wt(this._fadeFrame),this._fadeFrame=ut(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(A(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?ut(this._pruneTiles,this):setTimeout(g(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new k(this._wrapX?P(t.x,this._wrapX):t.x,this._wrapY?P(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Y(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function nr(t){return new Ze(t)}var ve=Ze.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=N(this,e),e.detectRetina&&b.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return O(i,"load",g(this._tileOnLoad,this,e,i)),O(i,"error",g(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return rt(this._url,m(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(g(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=S,e.onerror=S,!e.complete)){e.src=jt;var i=this._tiles[t].coords;J(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",jt),Ze.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===jt))return Ze.prototype._tileReady.call(this,t,e,i)}});function so(t,e){return new ve(t,e)}var ro=ve.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=m({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=N(this,e);var o=e.detectRetina&&b.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ve.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=ft(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Xn?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),u=ve.prototype.getTileUrl.call(this,t);return u+xt(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return m(this.wmsParams,t),e||this.redraw(),this}});function or(t,e){return new ro(t,e)}ve.WMS=ro,so.wms=or;var Vt=St.extend({options:{padding:.1},initialize:function(t){N(this,t),v(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),A(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?Qt(this._container,s,i):it(this._container,s)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Y(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ao=Vt.extend({options:{tolerance:0},getEvents:function(){var t=Vt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Vt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");O(t,"mousemove",this._onMouseMove,this),O(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),O(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){wt(this._redrawRequest),delete this._ctx,J(this._container),U(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Vt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1;it(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Vt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[v(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[v(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,o;for(o=0;o')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),sr={_initContainer:function(){this._container=D("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Vt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Re("shape");A(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Re("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[v(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;J(e),t.removeInteractiveTarget(e),delete this._layers[v(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Re("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=K(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Re("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},ui=b.vml?Re:dn,De=Vt.extend({_initContainer:function(){this._container=ui("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ui("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){J(this._container),U(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Vt.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),it(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=ui("path");t.options.className&&A(e,t.options.className),t.options.interactive&&A(e,"leaflet-interactive"),this._updateStyle(t),this._layers[v(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){J(t._path),t.removeInteractiveTarget(t._path),delete this._layers[v(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,fn(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,o="a"+i+","+n+" 0 1,0 ",s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+i*2+",0 "+o+-i*2+",0 ";this._setPath(t,s)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});b.vml&&De.include(sr);function uo(t){return b.svg||b.vml?new De(t):null}Z.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&lo(t)||uo(t)}});var ho=me.extend({initialize:function(t,e){me.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=et(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function rr(t,e){return new ho(t,e)}De.create=ui,De.pointsToPath=fn,Nt.geometryToLayer=ii,Nt.coordsToLatLng=Gi,Nt.coordsToLatLngs=ni,Nt.latLngToCoords=qi,Nt.latLngsToCoords=oi,Nt.getFeature=ge,Nt.asFeature=si,Z.mergeOptions({boxZoom:!0});var co=Et.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){O(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){U(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){J(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ze(),zi(),this._startPoint=this._map.mouseEventToContainerPoint(t),O(document,{contextmenu:ie,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=D("div","leaflet-zoom-box",this._container),A(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Y(this._point,this._startPoint),i=e.getSize();it(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(J(this._box),Q(this._container,"leaflet-crosshair")),ke(),ki(),U(document,{contextmenu:ie,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(g(this._resetState,this),0);var e=new _t(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Z.addInitHook("addHandler","boxZoom",co),Z.mergeOptions({doubleClickZoom:!0});var fo=Et.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});Z.addInitHook("addHandler","doubleClickZoom",fo),Z.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var _o=Et.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new qt(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}A(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Q(this._map._container,"leaflet-grab"),Q(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=et(this._map.options.maxBounds);this._offsetLimit=ft(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});Z.addInitHook("addHandler","scrollWheelZoom",mo);var ar=600;Z.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15});var go=Et.extend({addHooks:function(){O(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){U(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new k(e.clientX,e.clientY),this._holdTimeout=setTimeout(g(function(){this._cancel(),this._isTapValid()&&(O(document,"touchend",ht),O(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),ar),O(document,"touchend touchcancel contextmenu",this._cancel,this),O(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){U(document,"touchend",ht),U(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),U(document,"touchend touchcancel contextmenu",this._cancel,this),U(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new k(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});Z.addInitHook("addHandler","tapHold",go),Z.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0});var vo=Et.extend({addHooks:function(){A(this._map._container,"leaflet-touch-zoom"),O(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Q(this._map._container,"leaflet-touch-zoom"),U(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),O(document,"touchmove",this._onTouchMove,this),O(document,"touchend touchcancel",this._onTouchEnd,this),ht(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(o===1&&s.x===0&&s.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),wt(this._animRequest);var r=g(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ut(r,this,!0),ht(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,wt(this._animRequest),U(document,"touchmove",this._onTouchMove,this),U(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Z.addInitHook("addHandler","touchZoom",vo),Z.BoxZoom=co,Z.DoubleClickZoom=fo,Z.Drag=_o,Z.Keyboard=po,Z.ScrollWheelZoom=mo,Z.TapHold=go,Z.TouchZoom=vo,a.Bounds=Y,a.Browser=b,a.CRS=Zt,a.Canvas=ao,a.Circle=Ui,a.CircleMarker=ei,a.Class=Bt,a.Control=Tt,a.DivIcon=oo,a.DivOverlay=It,a.DomEvent=Ts,a.DomUtil=Ls,a.Draggable=qt,a.Evented=Pe,a.FeatureGroup=Rt,a.GeoJSON=Nt,a.GridLayer=Ze,a.Handler=Et,a.Icon=pe,a.ImageOverlay=ri,a.LatLng=W,a.LatLngBounds=_t,a.Layer=St,a.LayerGroup=_e,a.LineUtil=Ds,a.Map=Z,a.Marker=ti,a.Mixin=As,a.Path=Kt,a.Point=k,a.PolyUtil=Es,a.Polygon=me,a.Polyline=Dt,a.Popup=ai,a.PosAnimation=Vn,a.Projection=Ns,a.Rectangle=ho,a.Renderer=Vt,a.SVG=De,a.SVGOverlay=no,a.TileLayer=ve,a.Tooltip=li,a.Transformation=gi,a.Util=Uo,a.VideoOverlay=io,a.bind=g,a.bounds=ft,a.canvas=lo,a.circle=qs,a.circleMarker=Gs,a.control=Ee,a.divIcon=ir,a.extend=m,a.featureGroup=Ws,a.geoJSON=eo,a.geoJson=Ys,a.gridLayer=nr,a.icon=js,a.imageOverlay=Js,a.latLng=B,a.latLngBounds=et,a.layerGroup=Hs,a.map=Ss,a.marker=Us,a.point=z,a.polygon=$s,a.polyline=Ks,a.popup=tr,a.rectangle=rr,a.setOptions=N,a.stamp=v,a.svg=uo,a.svgOverlay=Qs,a.tileLayer=so,a.tooltip=er,a.transformation=Te,a.version=l,a.videoOverlay=Xs;var lr=window.L;a.noConflict=function(){return window.L=lr,this},window.L=a})})(nn,nn.exports);var Fe=nn.exports;const ma=Lr(Fe),ga=Ir({__proto__:null,default:ma},[Fe]);const va={components:{LMap:ea,LTileLayer:da,LMarker:aa,LTooltip:pa,L:Fe.L,icon:Fe.icon},setup(){const c=l=>`${pi}media/map_icons/${l}.png`,h={icon_cod:{iconUrl:c("fns"),iconSize:[30,30],iconAnchor:[16,40]},icon_metro:{iconUrl:c("mos_metro"),iconSize:[30,25],iconAnchor:[10,20]},icon_mcd:{iconUrl:c("mcd_d2"),iconSize:[32,18],iconAnchor:[10,20]},icon_bus:{iconUrl:c("bus"),iconSize:[18,18],iconAnchor:[1,1]}},a=G([{coordinate:[55.83451,37.40848],icon:h.icon_cod,tooltip:"МИ ФНС России по ЦОД №2",tooltip_bus:""},{coordinate:[55.83309,37.39933],icon:h.icon_mcd,tooltip:'МЦД D2: пл."Трикотажная"',tooltip_bus:""},{coordinate:[55.82741,37.43715],icon:h.icon_metro,tooltip:'Ст.метро: "Тушинская"',tooltip_bus:""},{coordinate:[55.82705,37.4411],icon:h.icon_mcd,tooltip:'МЦД D2: пл. "Тушинская"',tooltip_bus:""},{coordinate:[55.8496,37.43925],icon:h.icon_metro,tooltip:'Ст.метро: "Сходненская"',tooltip_bus:""},{coordinate:[55.835274,37.411052],icon:h.icon_bus,tooltip:'Остановка: "Налоговый городок"',tooltip_bus:"Автобусы:№368, №с377"},{coordinate:[55.833193,37.400858],icon:h.icon_bus,tooltip:'Остановка:"МЦД Трикотажная"',tooltip_bus:"Автобусы: №26, №368, №с377, №с396"},{coordinate:[55.82524,37.43575],icon:h.icon_bus,tooltip:'Остановка: "метро Тушинская", выход:5 ',tooltip_bus:"Автобусы: №400, №741, №741к, №856, №436, №575"},{coordinate:[55.8501,37.43905],icon:h.icon_bus,tooltip:'Остановка: "метро Сходненская", выход:9',tooltip_bus:"Автобус: №368"},{coordinate:[55.83607,37.40569],icon:h.icon_bus,tooltip:'Остановка "Храм Сергия Радонежского"',tooltip_bus:"Автобусы: №88, №488, №с377, №с396"},{coordinate:[55.83132,37.4034],icon:h.icon_bus,tooltip:'Остановка "МЦД Трикотажная"',tooltip_bus:"Автобусы: №2, №210, №400Т, №741, №741к, №856, №436, №575"}]);return{icons:h,markers:a,icon:Fe.icon,address:{building:"125373, Москва, Походный проезд, двл.3, стр 1",phone:"Телефон: 8(495) 198-53-12"},address_pathes:[{title_path:"От станции МЦД «Трикотажная»,",path:'на автобусе 368, до остановки "Налоговый городок" или пешком (10 минут) до территории Налоговго городка'},{title_path:"От станции метро «Сходненская», выход:9,",path:" 1-й вагон из центра, далее на автобусе № 368"},{title_path:"От станции МЦД «Тушинская»,",path:" проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка"},{title_path:"От станции метро «Тушинская», выход:5,",path:" последний вагон из центра, автобусы №2, №210, №400Т, №741, №741к, №856, №436, №575 до остановки «пл. Трикотажная» или от станции МЦД «Тушинская» проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка"},{title_path:"От остановки автобуса «Храм Сергия Радонежского»",path:" и далее пешком (10 минут) до территории Налоговго городка"}],work_times:[{day:"Понедельник - Четверг",time:"09:00 - 18:00"},{day:"Пятница",time:"09:00 - 16:45"},{day:"Суббота - Воскресенье",time:"Выходной"}],baseURL:pi}}},ya={style:{"max-width":"20%","min-width":"20%","word-wrap":"break-word"}};function xa(c,h,a,l,m,y){const g=vt("l-tile-layer"),x=vt("l-tooltip"),v=vt("l-marker"),M=vt("l-map");return V(),ot(R,{"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{lg:"5",md:"12",sm:"12",xs:"12",class:"flex-column d-flex"},{default:f(()=>[d(st,{elevation:"5",class:"h-100","min-height":"250"},{default:f(()=>[d(M,{zoom:14,"min-zoom":14,center:l.markers[0].coordinate},{default:f(()=>[d(g,{url:`${l.baseURL}media/Tiles/{z}/{x}/{y}.png`},null,8,["url"]),(V(!0),Ct(Ht,null,Yt(l.markers,P=>(V(),ot(v,{key:P,"lat-lng":P.coordinate,icon:l.icon(P.icon)},{default:f(()=>[d(x,null,{default:f(()=>[j("p",null,tt(P.tooltip),1),j("p",ya,tt(P.tooltip_bus),1)]),_:2},1024)]),_:2},1032,["lat-lng","icon"]))),128))]),_:1},8,["center"])]),_:1})]),_:1}),d(T,{class:"flex-column"},{default:f(()=>[d(R,{"no-gutters":"",class:"h-100 gap flex-column"},{default:f(()=>[d(T,{lg:"3",class:"w100 flex-column"},{default:f(()=>[d(st,{class:"h-100 flex-column d-flex",elevation:"5"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[d(R,null,{default:f(()=>[d(T,{lg:"5",class:"d-flex justify-center"},{default:f(()=>[F("Адрес")]),_:1}),d(T,{lg:"6",class:"d-flex justify-center"},{default:f(()=>[F("Время работы")]),_:1})]),_:1})]),_:1}),d(R,{class:"d-flex justify-center align-center"},{default:f(()=>[d(T,{lg:"4"},{default:f(()=>[d(yt,{class:"text-subtitle-1"},{default:f(()=>[F(tt(l.address.building),1)]),_:1}),d(yt,{class:"text-subtitle-1"},{default:f(()=>[F(tt(l.address.phone),1)]),_:1})]),_:1}),d(T,{lg:"7"},{default:f(()=>[d(en,null,{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.work_times,P=>(V(),ot(Xi,{key:P},{default:f(()=>[d(R,null,{default:f(()=>[d(T,{lg:"6",class:"text-subtitle-1 d-flex justify-center align-center"},{default:f(()=>[F(tt(P.day),1)]),_:2},1024),d(T,{lg:"6",class:"text-subtitle-1 d-flex justify-center align-center"},{default:f(()=>[F(tt(P.time),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),d(T,null,{default:f(()=>[d(st,{class:"h-100 flex-column d-flex",elevation:"5"},{default:f(()=>[d(dt,{class:"text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Способ проезда ")]),_:1}),d(yt,{class:"text-subtitle-1"},{default:f(()=>[d(en,{lines:"three"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.address_pathes,P=>(V(),ot(Xi,{key:P},{default:f(()=>[j("strong",null,tt(P.title_path),1),F(tt(P.path),1)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const wa=Xt(va,[["render",xa]]),ba={props:{title:{type:String,default:""},size:{type:Object,default:()=>{}}}},La=j("span",{class:"text-subtitle-1 text-grey"},"Данных нет",-1);function Pa(c,h,a,l,m,y){const g=vt("vue3-autocounter");return V(),ot(st,{class:"flex-grow-1 d-flex flex-column"},{default:f(()=>[d(dt,{class:"text-h6 text-center text-uppercase"},{default:f(()=>[F(tt(a.title),1)]),_:1}),Object.keys(a.size).length>0?(V(),Ct(Ht,{key:0},[d(st,{class:"h-100 flex-column d-flex align-center justify-center text-center elevation-0"},{default:f(()=>[d(g,{class:"text-h2 font-weight-regular pb-2",ref:"counter",startAmount:0,endAmount:a.size.size,duration:2},null,8,["endAmount"])]),_:1}),d(Qi,{class:"text-center"},{default:f(()=>[F("по состоянию на "+tt(new Date(a.size.date_created).toLocaleDateString("ru-RU")),1)]),_:1})],64)):(V(),ot(st,{key:1,class:"h-100 d-flex align-center justify-center text-center"},{default:f(()=>[La]),_:1}))]),_:1})}const Ta=Xt(ba,[["render",Pa]]),Sa={components:{GeneralInformationSize:Ta},setup(){const{lgAndUp:c}=Co(),h=G([]),a=G({factsize:0,date_created:new Date}),l=G({statesize:0,date_created:new Date}),m=G([]),y=()=>{Ne.get("api/accounts/getuser/?userlogin=9966-00-001").then(M=>{h.value=M.data})},g=()=>{Ne.get("api/about_inspection/getfactsize/").then(M=>{a.value=M.data})},x=()=>{Ne.get("api/about_inspection/getstatesize/").then(M=>{l.value=M.data})};return(()=>{Ne.get("api/about_inspection/getinspectiondirections/").then(M=>{m.value=M.data})})(),x(),g(),y(),{userlinks:h,checkremote:on,directionworks:m,getstatesize:l,getfactsize:a,spravURL:sn,baseURL:pi,lgAndUp:c,date_now:new Date().toLocaleDateString("ru-RU"),caCuratorLink:G("https://www.nalog.gov.ru/rn77/about_fts/fts/structure_fts/ca_fns/9515034/")}}},Ca=j("p",{class:"font-weight-medium text-lg-subtitle-1 text-sm-caption"}," создана 01.02.2018 года в соответствии с приказом ФНС России от 27.12.2017 №ММВ-7-4/1102 ",-1),Ma={class:"mt-3"},za=["href"],ka=j("p",null," Государственный советник Российской Федерации 2 класса ",-1);function Oa(c,h,a,l,m,y){const g=vt("general-information-size");return V(),ot(R,{"no-gutters":"",class:"flex-column h-100 gap"},{default:f(()=>[d(T,null,{default:f(()=>[d(R,{"no-gutters":"",class:"flex-column h-100 gap"},{default:f(()=>[d(T,{class:"w100 flex-grow-0"},{default:f(()=>[d(st,{class:"text-center"},{default:f(()=>[d(yt,{class:"font-weight-medium text-lg-h6"},{default:f(()=>[F(" Межрегиональная инспекция Федеральной налоговой службы по централизованной обработке данных №2 "),Ca,j("p",Ma,[j("a",{class:"text-decoration-none",href:l.caCuratorLink},"Работа МИ ФНС России по ЦОД №2 координируется заместителем руководителя ФНС России Будариным Андреем Владимировичем",8,za)])]),_:1})]),_:1})]),_:1}),d(T,{class:"d-flex"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,{lg:"3",class:"flex-column"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap flex-column h-100"},{default:f(()=>[d(T,{class:"w100"},{default:f(()=>[d(st,{class:"h-100"},{default:f(()=>[d(dt,{class:"text-h6 text-uppercase text-center"},{default:f(()=>[F(" Начальник инспекции")]),_:1}),d(tn,{class:"mb-3"}),d(Pr,{src:l.checkremote(`${l.spravURL}${l.userlinks.login}.jpg`),height:"200"},null,8,["src"]),d(dt,{class:"text-h6 text-center"},{default:f(()=>[F(tt(l.userlinks.fio),1)]),_:1}),d(yt,{class:"text-center text-body-2"},{default:f(()=>[ka]),_:1})]),_:1})]),_:1}),d(T,{class:"w100 flex-column d-flex"},{default:f(()=>[d(g,{size:l.getfactsize,title:"Фактическая численнность"},null,8,["size"])]),_:1}),d(T,{class:"w100 flex-column d-flex"},{default:f(()=>[d(g,{size:l.getstatesize,title:"Штатная численность"},null,8,["size"])]),_:1})]),_:1})]),_:1}),d(T,null,{default:f(()=>[d(st,{class:"h-100 flex-column d-flex"},{default:f(()=>[d(dt,{class:"text-h6 text-uppercase text-center"},{default:f(()=>[F(" Основные направления деятельности инспекции ")]),_:1}),d(tn,{class:"pb-3"}),d(R,{"no-gutters":"",class:Ji(["gap",l.lgAndUp?"h-0 overflow-auto":""])},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.directionworks,x=>(V(),ot(T,{class:"px-3 py-2 flex-grow-0",key:x.id},{default:f(()=>[d(st,{class:"d-flex",elevation:3},{default:f(()=>[d(T,{class:"d-flex align-center v-col-auto"},{default:f(()=>[d(Tr,{class:"elevation-10 text-teal-darken-4",color:"teal-lighten-5"},{default:f(()=>[d(Ve,{icon:x.icon_name},null,8,["icon"])]),_:2},1024)]),_:2},1024),d(T,{class:"d-flex align-center justify-start text-h6"},{default:f(()=>[F(tt(x.direction_title),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1},8,["class"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Aa=Xt(Sa,[["render",Oa]]),Ea={props:{idVacations:{type:Number,default:-1}},setup(c){const h=G({fio:"",email:"",tel:"",text:""}),a=Sr().alert,l=v=>!!v||"Поле обязательно",m={fio:[v=>l(v),v=>v.match(/^[а-яА-ЯЁё ]+$/)!==null||"Имя должно содержать русские буквы"],email:[v=>l(v)],tel:[v=>l(v),v=>v.match(/^[[\d-]*\d[\d-]*$/)!==null||"Номер должен содержать цифры"],text:""},y=G(null),g=G(null);return{form:h,file:y,rules:m,submit:()=>{if(g.value.isValid){const v=new FormData;v.append("data",JSON.stringify({...h.value,vacancy_id:c.idVacations})),y.value!==null&&v.append("file",y.value[0]),zo.post("api/about_inspection/postresponsevacancy/",v).then(M=>{a.alert=!0,a.text=M.data,a.color="teal-lighten-4",a.ico="mdi-email-outline"})}},form_vacancies:g}}},Ia=j("span",{class:"text-h4"},"Откликнуться на вакансию",-1);function Ba(c,h,a,l,m,y){return V(),Ct("div",null,[d(yt,{class:"text-center"},{default:f(()=>[Ia]),_:1}),d(yt,{class:"d-flex flex-column pt-0"},{default:f(()=>[d(Or,{ref:"form_vacancies",onSubmit:Cr(l.submit,["prevent"])},{default:f(()=>[d(R,{"no-gutters":"",class:"justify-center"},{default:f(()=>[d(T,{lg:"8"},{default:f(()=>[d(Yi,{modelValue:l.form.fio,"onUpdate:modelValue":h[0]||(h[0]=g=>l.form.fio=g),counter:10,rules:l.rules.fio,label:"Фамилия, имя, отчество"},null,8,["modelValue","rules"]),d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,null,{default:f(()=>[d(Yi,{modelValue:l.form.email,"onUpdate:modelValue":h[1]||(h[1]=g=>l.form.email=g),rules:l.rules.email,label:"E-mail или почта Lotus"},null,8,["modelValue","rules"])]),_:1}),d(T,null,{default:f(()=>[d(Yi,{modelValue:l.form.tel,"onUpdate:modelValue":h[2]||(h[2]=g=>l.form.tel=g),counter:7,rules:l.rules.tel,label:"Телефон"},null,8,["modelValue","rules"])]),_:1})]),_:1}),d(Ar,{modelValue:l.form.text,"onUpdate:modelValue":h[3]||(h[3]=g=>l.form.text=g),"no-resize":"",rows:"4",label:"Сопроводительное письмо"},null,8,["modelValue"]),d(Er,{label:"Резюме","hide-details":"",modelValue:l.file,"onUpdate:modelValue":h[4]||(h[4]=g=>l.file=g)},null,8,["modelValue"]),d(Mo,{block:"",type:"submit",class:"mt-4 text-none",color:"btn_text"},{default:f(()=>[F(" Отправить ")]),_:1})]),_:1})]),_:1})]),_:1},8,["onSubmit"])]),_:1})])}const Za=Xt(Ea,[["render",Ba]]);const Ra={components:{ResponseVacancies:Za},setup(){const c=Mr();let h=G({name:"",department:{name:""}}),a=G(-1),l=G({});const m=()=>{zo.get("api/about_inspection/getvacancy/").then(x=>{l.value=x.data,h.value=l.value[0],a.value=l.value[0].id})},y=x=>x.replaceAll('src="/media/uploads',`src="${pi}media/uploads`),g=x=>{a.value!=x?(a.value=x,h.value=l.value.find(v=>v.id==x)):(a.value=-1,h.value={name:"",department:{name:""}})};return m(),{vacancy:l,formatText:y,vacancyDescription:h,getIndVacation:g,vacancySelect:a,goTo:c}}},Da={class:"text-h4 text-wrap"},Na={class:"text-h5"},Va=j("span",{class:"text-h6"}," Направление деятельности подразделения ",-1),Fa=j("span",{class:"text-h6"}," Функционал и должностные обязанности ",-1),Ha=["innerHTML"],Wa=j("span",{class:"text-h6"}," Базовые требования к соискателю ",-1),ja=["innerHTML"],Ua=j("br",null,null,-1),Ga=j("span",{class:"text-h5 text-grey"},[F("Для подробного описания вакансии "),j("br"),F(" выберите её из списка слева")],-1),qa=j("br",null,null,-1),Ka=j("span",{class:"text-h5 text-grey"},[F("Сейчас вакансий нет, "),j("br"),F(" загляните позжет")],-1);function $a(c,h,a,l,m,y){const g=vt("response-vacancies");return l.vacancy.length>0?(V(),ot(R,{key:0,"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{lg:"4",class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex flex-column rounded-0"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Вакансии ")]),_:1}),d(R,{"no-gutters":"",class:"h-0 gap overflow-auto"},{default:f(()=>[d(T,null,{default:f(()=>[d(st,{class:"mx-auto h-100"},{default:f(()=>[d(en,{density:"compact",class:"px-0"},{default:f(()=>[(V(!0),Ct(Ht,null,Yt(l.vacancy,x=>(V(),ot(Xi,{key:x.id,value:x,class:"border-b-sm","active-class":"custom-active",color:"teal-darken-3",onClick:v=>l.getIndVacation(x.id)},{default:f(()=>[d(st,{class:"rounded-0 bg-transparent"},{default:f(()=>[d(dt,{class:"text-wrap"},{default:f(()=>[F(tt(x.name),1)]),_:2},1024),d(yt,{class:"pb-2"},{default:f(()=>[d(R,{"no-gutters":"",class:"gap"},{default:f(()=>[d(T,null,{default:f(()=>[F(tt(x.department.name),1)]),_:2},1024),d(T,{class:"flex-grow-0 text-subtitle-1 text-btn_text"},{default:f(()=>[F(" Подробнее ")]),_:1}),d(T,{class:"flex-grow-0 align-self-center pl-2"},{default:f(()=>[d(Ve,{icon:"mdi-arrow-right",color:"btn_text",size:"small"})]),_:1})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),d(T,{class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex flex-column rounded-0"},{default:f(()=>[d(dt,{class:"d-flex justify-center bg-teal-lighten-5 text-teal-darken-4"},{default:f(()=>[F(" Описание ")]),_:1}),d(R,{"no-gutters":"",class:"h-0 gap overflow-auto",id:"goto-container-example"},{default:f(()=>[d(T,null,{default:f(()=>[l.vacancyDescription.name!=""?(V(),ot(st,{key:0,class:"rounded-0 h-100"},{default:f(()=>[d(dt,{class:"mt-4"},{default:f(()=>[j("span",Da,tt(l.vacancyDescription.name),1)]),_:1}),d(dt,{class:"pt-0"},{default:f(()=>[j("span",Na,tt(l.vacancyDescription.department.name),1)]),_:1}),d(dt,null,{default:f(()=>[d(Mo,{type:"submit",class:"text-subtitle-1 font-weight-light",color:"btn_text",elevation:"1",onClick:h[0]||(h[0]=x=>l.goTo("#response",{container:"#goto-container-example"}))},{default:f(()=>[F(" Откликнуться ")]),_:1})]),_:1}),d(dt,{class:"pt-6"},{default:f(()=>[Va]),_:1}),d(yt,{class:"mx-5 my-1"},{default:f(()=>[j("ul",null,[(V(!0),Ct(Ht,null,Yt(l.vacancyDescription.department.department_directions,x=>(V(),Ct("li",{class:"py-1",key:x},tt(x.direction_title),1))),128))])]),_:1}),d(dt,null,{default:f(()=>[Fa]),_:1}),d(yt,{class:"mx-5 my-0 ckeditor_ul"},{default:f(()=>[j("div",{class:"py-1",innerHTML:l.vacancyDescription.functional},null,8,Ha)]),_:1}),d(dt,null,{default:f(()=>[Wa]),_:1}),d(yt,{class:"mx-5 my-0 ckeditor_ul"},{default:f(()=>[j("div",{class:"py-1",innerHTML:l.vacancyDescription.requirements},null,8,ja)]),_:1}),d(tn),d(g,{id:"response",idVacations:l.vacancySelect},null,8,["idVacations"])]),_:1})):(V(),ot(st,{key:1,class:"h-100 pa-1 d-flex align-center justify-center text-center"},{default:f(()=>[d(Qi,null,{default:f(()=>[d(Ve,{icon:"mdi-format-list-bulleted",color:"grey",size:"x-large"}),Ua,Ga]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(V(),ot(R,{key:1,"no-gutters":"",class:"h-100 gap"},{default:f(()=>[d(T,{class:"flex-column d-flex"},{default:f(()=>[d(st,{class:"h-100 pa-1 d-flex align-center justify-center text-center"},{default:f(()=>[d(Qi,null,{default:f(()=>[d(Ve,{icon:"mdi-credit-card-off",size:"x-large",color:"grey"}),qa,Ka]),_:1})]),_:1})]),_:1})]),_:1}))}const Ya=Xt(Ra,[["render",$a]]);const Ja={components:{StructureInspection:Wr,ContactInfo:wa,PatternTabs:kr,GeneralInformation:Aa,OpenVacancies:Ya},setup(){return zr(),{tabs_items:[{title:"Общая информация",value:"mainInfo"},{title:"Структура инспекции",value:"structureInspection"},{title:"Открытые вакансии",value:"openVacancies"},{title:"Контактная информация",value:"contactInfo"}]}}};function Xa(c,h,a,l,m,y){const g=vt("general-information"),x=vt("structure-inspection"),v=vt("open-vacancies"),M=vt("contact-info"),P=vt("pattern-tabs");return V(),ot(P,{tabs:l.tabs_items},{item:f(()=>[d(di,{class:"gap h-100",value:"mainInfo"},{default:f(()=>[d(g)]),_:1}),d(di,{class:"gap h-100",value:"structureInspection"},{default:f(()=>[d(x)]),_:1}),d(di,{class:"gap h-100",value:"openVacancies"},{default:f(()=>[d(v)]),_:1}),d(di,{class:"gap h-100",value:"contactInfo"},{default:f(()=>[d(M)]),_:1})]),_:1},8,["tabs"])}const dl=Xt(Ja,[["render",Xa]]);export{dl as default}; diff --git a/src/front/dist/assets/AboutPortalPage-c211779b.js b/src/front/dist/assets/AboutPortalPage-d22e7dab.js similarity index 78% rename from src/front/dist/assets/AboutPortalPage-c211779b.js rename to src/front/dist/assets/AboutPortalPage-d22e7dab.js index f6ab903a6..b5e3af38c 100644 --- a/src/front/dist/assets/AboutPortalPage-c211779b.js +++ b/src/front/dist/assets/AboutPortalPage-d22e7dab.js @@ -1,29 +1,29 @@ -var yr=Object.defineProperty;var xr=(i,t,e)=>t in i?yr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var O=(i,t,e)=>(xr(i,typeof t!="symbol"?t+"":t,e),e);import{de as vr,d as wr,r as J,_ as ut,Q as G,s as R,t as H,v as x,x as b,E as F,y as Q,$ as W,a4 as Yt,V as wt,z as et,M as T,D as U,R as ft,K as ge,cS as ko,C as _n,c3 as So,a7 as pt,ak as ke,f as B,ao as Mo,p as Ce,df as Po,w as oi,k as De,ai as sn,ab as ne,dg as Xi,af as pe,dh as kr,at as Mt,b8 as Sr,di as Mr,dj as Co,dk as on,an as rt,dl as li,c$ as ns,ay as Fn,dm as Pr,dn as Cr,aC as Dr,aE as Ln,dp as Tr,S as vt,dq as Do,A as Ai,dr as an,cG as ss,a8 as Or,db as Ar,aq as Ir,aa as Rr,ac as Fr,dc as Lr,ds as ci,aJ as To,Z as Oo,ah as Ii,O as Er,P as zr,T as ee,aP as qt,a0 as Qe,dt as Ao,cT as Br,du as Io,bN as Ri,by as Fi,dv as Kt,m as Vr,dw as Ot,a2 as Ro,cR as Hr,bk as Fo,bz as yn,cz as Wr,q as Nr,e as jr,ci as xn,n as $r,bG as Lo,dx as at,dy as os,cV as Yr,U as Ur,dz as Xr}from"./index-84cc8e63.js";import{V as as}from"./VPagination-844eb136.js";import{V as Eo}from"./VSelect-db8f1e56.js";import{V as En}from"./VCheckboxBtn-c07777d8.js";import{m as zo,u as Bo,a as Gr,V as qr}from"./VLocaleProvider-396cfd34.js";import{m as Kr,u as Jr,V as Qr}from"./VVirtualScroll-9b239331.js";import{a as Zr,F as tl,V as el}from"./VToolbar-f40f893b.js";import{V as il}from"./VTextarea-08b60249.js";import{V as nl}from"./VSwitch-17908f52.js";import"./VTextField-4eb073db.js";/* empty css */import"./VField-e3c852c7.js";import"./VInput-e5a7e0e7.js";import"./VList-d0850642.js";import"./ssrBoot-04c9ae84.js";import"./VSelectionControl-b8db7e28.js";import"./VSpacer-bea6911b.js";function rs(i,t,e){return Object.keys(i).filter(n=>vr(n)&&n.endsWith(t)).reduce((n,s)=>(n[s.slice(0,-t.length)]=o=>i[s](o,e(o)),n),{})}const Gi=wr("filter",()=>({date_period:J({startdate:new Date(new Date().getFullYear(),0,1),enddate:new Date})})),sl={props:{indicator:{type:Object,default:{}}}},ol={class:"text-caption"},al={key:1};function rl(i,t,e,n,s,o){const a=G("vue3-autocounter");return R(),H(ge,{class:"text-center text-blue-grey-darken-4 d-flex h-100 flex-column cursor-default justify-center"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"text-h5 font-weight-bold pl-5"},{default:x(()=>[Q(W(e.indicator.title)+" ",1),b(Yt,{width:"250"},{activator:x(({props:r})=>[b(wt,et({icon:"mdi-information",color:"cyan-darken-3",size:"12"},r,{class:"align-self-end pr-2 pb-5 cursor-help"}),null,16)]),default:x(()=>[T("span",ol,W(e.indicator.tooltip),1)]),_:1})]),_:1})]),_:1}),b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"text-h6 font-weight-medium"},{default:x(()=>[Q(W(e.indicator.abb),1)]),_:1})]),_:1}),b(U,{"no-gutters":"",class:"flex-grow-0 pt-3"},{default:x(()=>[b(F,{class:"text-h3 text-grey-darken-3 text-center font-weight-regular align-self-center"},{default:x(()=>[Number.isNaN(e.indicator.data)?(R(),ft("div",al,[b(U,null,{default:x(()=>[b(F,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" Данных нет ")]),_:1})]),_:1})])):(R(),H(a,{key:0,ref:"counter",startAmount:0,endAmount:e.indicator.data,duration:1,decimals:Number.isInteger(e.indicator.data)?0:2,suffix:e.indicator.abb=="(PPV)"?"":"%"},null,8,["endAmount","decimals","suffix"]))]),_:1})]),_:1})]),_:1})}const Vo=ut(sl,[["render",rl]]),ll={props:{title:{type:String,default:""},ico:{type:String,default:""}}};function cl(i,t,e,n,s,o){return R(),H(ge,{class:"text-center h-100 d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"d-flex flex-column pa-1"},{default:x(()=>[b(ko,{color:"light-blue-darken-4",label:"",class:"text-center text-cyan-darken-4 rounded-0 text-subtitle-1 font-weight-medium"},{default:x(()=>[b(wt,{start:"",color:"cyan-darken-4",icon:e.ico},null,8,["icon"]),Q(" "+W(e.title),1)]),_:1})]),_:1})]),_:1}),b(U,{"no-gutters":""},{default:x(()=>[b(F,{class:"flex-column d-flex"},{default:x(()=>[b(_n,{class:"px-3 py-1 flex-column d-flex h-0 overflow-x-auto overflow-x-hidden"},{default:x(()=>[So(i.$slots,"filling")]),_:3})]),_:3})]),_:3})]),_:3})}const qi=ut(ll,[["render",cl]]);const dl=pt({page:{type:[Number,String],default:1},itemsPerPage:{type:[Number,String],default:10}},"DataTable-paginate"),Ho=Symbol.for("vuetify:data-table-pagination");function ul(i){const t=ke(i,"page",void 0,n=>+(n??1)),e=ke(i,"itemsPerPage",void 0,n=>+(n??10));return{page:t,itemsPerPage:e}}function hl(i){const{page:t,itemsPerPage:e,itemsLength:n}=i,s=B(()=>e.value===-1?0:e.value*(t.value-1)),o=B(()=>e.value===-1?n.value:Math.min(n.value,s.value+e.value)),a=B(()=>e.value===-1||n.value===0?1:Math.ceil(n.value/e.value));Mo(()=>{t.value>a.value&&(t.value=a.value)});function r(h){e.value=h,t.value=1}function l(){t.value=sn(t.value+1,1,a.value)}function c(){t.value=sn(t.value-1,1,a.value)}function d(h){t.value=sn(h,1,a.value)}const u={page:t,itemsPerPage:e,startIndex:s,stopIndex:o,pageCount:a,itemsLength:n,nextPage:l,prevPage:c,setPage:d,setItemsPerPage:r};return Ce(Ho,u),u}function fl(){const i=De(Ho);if(!i)throw new Error("Missing pagination!");return i}function gl(i){const t=Po("usePaginatedItems"),{items:e,startIndex:n,stopIndex:s,itemsPerPage:o}=i,a=B(()=>o.value<=0?e.value:e.value.slice(n.value,s.value));return oi(a,r=>{t.emit("update:currentItems",r)}),{paginatedItems:a}}const Wo=pt({prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},pageText:{type:String,default:"$vuetify.dataFooter.pageText"},firstPageLabel:{type:String,default:"$vuetify.dataFooter.firstPage"},prevPageLabel:{type:String,default:"$vuetify.dataFooter.prevPage"},nextPageLabel:{type:String,default:"$vuetify.dataFooter.nextPage"},lastPageLabel:{type:String,default:"$vuetify.dataFooter.lastPage"},itemsPerPageOptions:{type:Array,default:()=>[{value:10,title:"10"},{value:25,title:"25"},{value:50,title:"50"},{value:100,title:"100"},{value:-1,title:"$vuetify.dataFooter.itemsPerPageAll"}]},showCurrentPage:Boolean},"VDataTableFooter"),ls=ne()({name:"VDataTableFooter",props:Wo(),setup(i,t){let{slots:e}=t;const{t:n}=Xi(),{page:s,pageCount:o,startIndex:a,stopIndex:r,itemsLength:l,itemsPerPage:c,setItemsPerPage:d}=fl(),u=B(()=>i.itemsPerPageOptions.map(h=>typeof h=="number"?{value:h,title:h===-1?n("$vuetify.dataFooter.itemsPerPageAll"):String(h)}:{...h,title:isNaN(Number(h.title))?n(h.title):h.title}));return pe(()=>{var f;const h=as.filterProps(i);return b("div",{class:"v-data-table-footer"},[(f=e.prepend)==null?void 0:f.call(e),b("div",{class:"v-data-table-footer__items-per-page"},[b("span",null,[n(i.itemsPerPageText)]),b(Eo,{items:u.value,modelValue:c.value,"onUpdate:modelValue":g=>d(Number(g)),density:"compact",variant:"outlined","hide-details":!0},null)]),b("div",{class:"v-data-table-footer__info"},[b("div",null,[n(i.pageText,l.value?a.value+1:0,r.value,l.value)])]),b("div",{class:"v-data-table-footer__pagination"},[b(as,et({modelValue:s.value,"onUpdate:modelValue":g=>s.value=g,density:"comfortable","first-aria-label":i.firstPageLabel,"last-aria-label":i.lastPageLabel,length:o.value,"next-aria-label":i.nextPageLabel,"previous-aria-label":i.prevPageLabel,rounded:!0,"show-first-last-page":!0,"total-visible":i.showCurrentPage?1:0,variant:"plain"},h),null)])])}),{}}}),Li=kr({align:{type:String,default:"start"},fixed:Boolean,fixedOffset:[Number,String],height:[Number,String],lastFixed:Boolean,noPadding:Boolean,tag:String,width:[Number,String],maxWidth:[Number,String],nowrap:Boolean},(i,t)=>{let{slots:e}=t;const n=i.tag??"td";return b(n,{class:["v-data-table__td",{"v-data-table-column--fixed":i.fixed,"v-data-table-column--last-fixed":i.lastFixed,"v-data-table-column--no-padding":i.noPadding,"v-data-table-column--nowrap":i.nowrap},`v-data-table-column--align-${i.align}`],style:{height:Mt(i.height),width:Mt(i.width),maxWidth:Mt(i.maxWidth),left:Mt(i.fixedOffset||null)}},{default:()=>{var s;return[(s=e.default)==null?void 0:s.call(e)]}})}),pl=pt({headers:Array},"DataTable-header"),No=Symbol.for("vuetify:data-table-headers"),jo={title:"",sortable:!1},ml={...jo,width:48};function bl(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>({element:e,priority:0}));return{enqueue:(e,n)=>{let s=!1;for(let o=0;on){t.splice(o,0,{element:e,priority:n}),s=!0;break}s||t.push({element:e,priority:n})},size:()=>t.length,count:()=>{let e=0;if(!t.length)return 0;const n=Math.floor(t[0].priority);for(let s=0;st.shift()}}function vn(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(!i.children)t.push(i);else for(const e of i.children)vn(e,t);return t}function $o(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;for(const e of i)e.key&&t.add(e.key),e.children&&$o(e.children,t);return t}function _l(i){if(i.key){if(i.key==="data-table-group")return jo;if(["data-table-expand","data-table-select"].includes(i.key))return ml}}function zn(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return i.children?Math.max(t,...i.children.map(e=>zn(e,t+1))):t}function yl(i){let t=!1;function e(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(o)if(a&&(o.fixed=!0),o.fixed)if(o.children)for(let r=o.children.length-1;r>=0;r--)e(o.children[r],!0);else t?isNaN(+o.width)&&Mr(`Multiple fixed columns should have a static width (key: ${o.key})`):o.lastFixed=!0,t=!0;else if(o.children)for(let r=o.children.length-1;r>=0;r--)e(o.children[r]);else t=!1}for(let o=i.length-1;o>=0;o--)e(i[o]);function n(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!o)return a;if(o.children){o.fixedOffset=a;for(const r of o.children)a=n(r,a)}else o.fixed&&(o.fixedOffset=a,a+=parseFloat(o.width||"0")||0);return a}let s=0;for(const o of i)s=n(o,s)}function xl(i,t){const e=[];let n=0;const s=bl(i);for(;s.size()>0;){let a=s.count();const r=[];let l=1;for(;a>0;){const{element:c,priority:d}=s.dequeue(),u=t-n-zn(c);if(r.push({...c,rowspan:u??1,colspan:c.children?vn(c).length:1}),c.children)for(const h of c.children){const f=d%1+l/Math.pow(10,n+2);s.enqueue(h,n+u+f)}l+=1,a-=1}n+=1,e.push(r)}return{columns:i.map(a=>vn(a)).flat(),headers:e}}function Yo(i){const t=[];for(const e of i){const n={..._l(e),...e},s=n.key??(typeof n.value=="string"?n.value:null),o=n.value??s??null,a={...n,key:s,value:o,sortable:n.sortable??(n.key!=null||!!n.sort),children:n.children?Yo(n.children):void 0};t.push(a)}return t}function Uo(i,t){const e=J([]),n=J([]),s=J({}),o=J({}),a=J({});Mo(()=>{var m,p,_;const c=(i.headers||Object.keys(i.items[0]??{}).map(y=>({key:y,title:Sr(y)}))).slice(),d=$o(c);(m=t==null?void 0:t.groupBy)!=null&&m.value.length&&!d.has("data-table-group")&&c.unshift({key:"data-table-group",title:"Group"}),(p=t==null?void 0:t.showSelect)!=null&&p.value&&!d.has("data-table-select")&&c.unshift({key:"data-table-select"}),(_=t==null?void 0:t.showExpand)!=null&&_.value&&!d.has("data-table-expand")&&c.push({key:"data-table-expand"});const u=Yo(c);yl(u);const h=Math.max(...u.map(y=>zn(y)))+1,f=xl(u,h);e.value=f.headers,n.value=f.columns;const g=f.headers.flat(1);for(const y of g)y.key&&(y.sortable&&(y.sort&&(s.value[y.key]=y.sort),y.sortRaw&&(o.value[y.key]=y.sortRaw)),y.filter&&(a.value[y.key]=y.filter))});const r={headers:e,columns:n,sortFunctions:s,sortRawFunctions:o,filterFunctions:a};return Ce(No,r),r}function Ki(){const i=De(No);if(!i)throw new Error("Missing headers!");return i}const vl={showSelectAll:!1,allSelected:()=>[],select:i=>{var n;let{items:t,value:e}=i;return new Set(e?[(n=t[0])==null?void 0:n.value]:[])},selectAll:i=>{let{selected:t}=i;return t}},Xo={showSelectAll:!0,allSelected:i=>{let{currentPage:t}=i;return t},select:i=>{let{items:t,value:e,selected:n}=i;for(const s of t)e?n.add(s.value):n.delete(s.value);return n},selectAll:i=>{let{value:t,currentPage:e,selected:n}=i;return Xo.select({items:e,value:t,selected:n})}},Go={showSelectAll:!0,allSelected:i=>{let{allItems:t}=i;return t},select:i=>{let{items:t,value:e,selected:n}=i;for(const s of t)e?n.add(s.value):n.delete(s.value);return n},selectAll:i=>{let{value:t,allItems:e,selected:n}=i;return Go.select({items:e,value:t,selected:n})}},wl=pt({showSelect:Boolean,selectStrategy:{type:[String,Object],default:"page"},modelValue:{type:Array,default:()=>[]},valueComparator:{type:Function,default:Co}},"DataTable-select"),qo=Symbol.for("vuetify:data-table-selection");function Ko(i,t){let{allItems:e,currentPage:n}=t;const s=ke(i,"modelValue",i.modelValue,_=>new Set(on(_).map(y=>{var w;return((w=e.value.find(M=>i.valueComparator(y,M.value)))==null?void 0:w.value)??y})),_=>[..._.values()]),o=B(()=>e.value.filter(_=>_.selectable)),a=B(()=>n.value.filter(_=>_.selectable)),r=B(()=>{if(typeof i.selectStrategy=="object")return i.selectStrategy;switch(i.selectStrategy){case"single":return vl;case"all":return Go;case"page":default:return Xo}});function l(_){return on(_).every(y=>s.value.has(y.value))}function c(_){return on(_).some(y=>s.value.has(y.value))}function d(_,y){const w=r.value.select({items:_,value:y,selected:new Set(s.value)});s.value=w}function u(_){d([_],!l([_]))}function h(_){const y=r.value.selectAll({value:_,allItems:o.value,currentPage:a.value,selected:new Set(s.value)});s.value=y}const f=B(()=>s.value.size>0),g=B(()=>{const _=r.value.allSelected({allItems:o.value,currentPage:a.value});return!!_.length&&l(_)}),m=B(()=>r.value.showSelectAll),p={toggleSelect:u,select:d,selectAll:h,isSelected:l,isSomeSelected:c,someSelected:f,allSelected:g,showSelectAll:m};return Ce(qo,p),p}function Ji(){const i=De(qo);if(!i)throw new Error("Missing selection!");return i}const kl=pt({sortBy:{type:Array,default:()=>[]},customKeySort:Object,multiSort:Boolean,mustSort:Boolean},"DataTable-sort"),Jo=Symbol.for("vuetify:data-table-sort");function Qo(i){const t=ke(i,"sortBy"),e=rt(i,"mustSort"),n=rt(i,"multiSort");return{sortBy:t,mustSort:e,multiSort:n}}function Zo(i){const{sortBy:t,mustSort:e,multiSort:n,page:s}=i,o=l=>{if(l.key==null)return;let c=t.value.map(u=>({...u}))??[];const d=c.find(u=>u.key===l.key);d?d.order==="desc"?e.value?d.order="asc":c=c.filter(u=>u.key!==l.key):d.order="desc":n.value?c=[...c,{key:l.key,order:"asc"}]:c=[{key:l.key,order:"asc"}],t.value=c,s&&(s.value=1)};function a(l){return!!t.value.find(c=>c.key===l.key)}const r={sortBy:t,toggleSort:o,isSorted:a};return Ce(Jo,r),r}function ta(){const i=De(Jo);if(!i)throw new Error("Missing sort!");return i}function ea(i,t,e,n){const s=Xi();return{sortedItems:B(()=>{var a,r;return!e.value.length||i.disableSort?t.value:Sl(t.value,e.value,s.current.value,{transform:n==null?void 0:n.transform,sortFunctions:{...i.customKeySort,...(a=n==null?void 0:n.sortFunctions)==null?void 0:a.value},sortRawFunctions:(r=n==null?void 0:n.sortRawFunctions)==null?void 0:r.value})})}}function Sl(i,t,e,n){const s=new Intl.Collator(e,{sensitivity:"accent",usage:"sort"});return i.map(a=>[a,n!=null&&n.transform?n.transform(a):a]).sort((a,r)=>{var l,c;for(let d=0;dy!=null?y.toString().toLocaleLowerCase():y),g!==m)return li(g)&&li(m)?0:li(g)?-1:li(m)?1:!isNaN(g)&&!isNaN(m)?Number(g)-Number(m):s.compare(g,m)}}return 0}).map(a=>{let[r]=a;return r})}const ia=pt({color:String,sticky:Boolean,disableSort:Boolean,multiSort:Boolean,sortAscIcon:{type:ns,default:"$sortAsc"},sortDescIcon:{type:ns,default:"$sortDesc"},headerProps:{type:Object},...Fn(),...Pr()},"VDataTableHeaders"),Ei=ne()({name:"VDataTableHeaders",props:ia(),setup(i,t){let{slots:e}=t;const{t:n}=Xi(),{toggleSort:s,sortBy:o,isSorted:a}=ta(),{someSelected:r,allSelected:l,selectAll:c,showSelectAll:d}=Ji(),{columns:u,headers:h}=Ki(),{loaderClasses:f}=Cr(i);function g(S,k){if(!(!i.sticky&&!S.fixed))return{position:"sticky",left:S.fixed?Mt(S.fixedOffset):void 0,top:i.sticky?`calc(var(--v-table-header-height) * ${k})`:void 0}}function m(S){const k=o.value.find(A=>A.key===S.key);return k?k.order==="asc"?i.sortAscIcon:i.sortDescIcon:i.sortAscIcon}const{backgroundColorClasses:p,backgroundColorStyles:_}=Dr(i,"color"),{displayClasses:y,mobile:w}=Ln(i),M=B(()=>({headers:h.value,columns:u.value,toggleSort:s,isSorted:a,sortBy:o.value,someSelected:r.value,allSelected:l.value,selectAll:c,getSortIcon:m})),v=B(()=>["v-data-table__th",{"v-data-table__th--sticky":i.sticky},y.value,f.value]),C=S=>{let{column:k,x:A,y:D}=S;const I=k.key==="data-table-select"||k.key==="data-table-expand",j=et(i.headerProps??{},k.headerProps??{});return b(Li,et({tag:"th",align:k.align,class:[{"v-data-table__th--sortable":k.sortable&&!i.disableSort,"v-data-table__th--sorted":a(k),"v-data-table__th--fixed":k.fixed},...v.value],style:{width:Mt(k.width),minWidth:Mt(k.minWidth),maxWidth:Mt(k.maxWidth),...g(k,D)},colspan:k.colspan,rowspan:k.rowspan,onClick:k.sortable?()=>s(k):void 0,fixed:k.fixed,nowrap:k.nowrap,lastFixed:k.lastFixed,noPadding:I},j),{default:()=>{var z;const K=`header.${k.key}`,L={column:k,selectAll:c,isSorted:a,toggleSort:s,sortBy:o.value,someSelected:r.value,allSelected:l.value,getSortIcon:m};return e[K]?e[K](L):k.key==="data-table-select"?((z=e["header.data-table-select"])==null?void 0:z.call(e,L))??(d.value&&b(En,{modelValue:l.value,indeterminate:r.value&&!l.value,"onUpdate:modelValue":c},null)):b("div",{class:"v-data-table-header__content"},[b("span",null,[k.title]),k.sortable&&!i.disableSort&&b(wt,{key:"icon",class:"v-data-table-header__sort-icon",icon:m(k)},null),i.multiSort&&a(k)&&b("div",{key:"badge",class:["v-data-table-header__sort-badge",...p.value],style:_.value},[o.value.findIndex($=>$.key===k.key)+1])])}})},P=()=>{const S=et(i.headerProps??{}??{}),k=B(()=>u.value.filter(D=>(D==null?void 0:D.sortable)&&!i.disableSort)),A=B(()=>{if(u.value.find(I=>I.key==="data-table-select")!=null)return l.value?"$checkboxOn":r.value?"$checkboxIndeterminate":"$checkboxOff"});return b(Li,et({tag:"th",class:[...v.value],colspan:h.value.length+1},S),{default:()=>[b("div",{class:"v-data-table-header__content"},[b(Eo,{chips:!0,class:"v-data-table__td-sort-select",clearable:!0,density:"default",items:k.value,label:n("$vuetify.dataTable.sortBy"),multiple:i.multiSort,variant:"underlined","onClick:clear":()=>o.value=[],appendIcon:A.value,"onClick:append":()=>c(!l.value)},{...e,chip:D=>{var I;return b(ko,{onClick:(I=D.item.raw)!=null&&I.sortable?()=>s(D.item.raw):void 0,onMousedown:j=>{j.preventDefault(),j.stopPropagation()}},{default:()=>[D.item.title,b(wt,{class:["v-data-table__td-sort-icon",a(D.item.raw)&&"v-data-table__td-sort-icon-active"],icon:m(D.item.raw),size:"small"},null)]})}})])]})};pe(()=>w.value?b("tr",null,[b(P,null,null)]):b(vt,null,[e.headers?e.headers(M.value):h.value.map((S,k)=>b("tr",null,[S.map((A,D)=>b(C,{column:A,x:D,y:k},null))])),i.loading&&b("tr",{class:"v-data-table-progress"},[b("th",{colspan:u.value.length},[b(Tr,{name:"v-data-table-progress",absolute:!0,active:!0,color:typeof i.loading=="boolean"?void 0:i.loading,indeterminate:!0},{default:e.loader})])])]))}}),na=pt({groupBy:{type:Array,default:()=>[]}},"DataTable-group"),sa=Symbol.for("vuetify:data-table-group");function oa(i){return{groupBy:ke(i,"groupBy")}}function aa(i){const{groupBy:t,sortBy:e}=i,n=J(new Set),s=B(()=>t.value.map(c=>({...c,order:c.order??!1})).concat(e.value));function o(c){return n.value.has(c.id)}function a(c){const d=new Set(n.value);o(c)?d.delete(c.id):d.add(c.id),n.value=d}function r(c){function d(u){const h=[];for(const f of u.items)"type"in f&&f.type==="group"?h.push(...d(f)):h.push(f);return h}return d({type:"group",items:c,id:"dummy",key:"dummy",value:"dummy",depth:0})}const l={sortByWithGroups:s,toggleGroup:a,opened:n,groupBy:t,extractRows:r,isGroupOpen:o};return Ce(sa,l),l}function ra(){const i=De(sa);if(!i)throw new Error("Missing group!");return i}function Ml(i,t){if(!i.length)return[];const e=new Map;for(const n of i){const s=Do(n.raw,t);e.has(s)||e.set(s,[]),e.get(s).push(n)}return e}function la(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"root";if(!t.length)return[];const s=Ml(i,t[0]),o=[],a=t.slice(1);return s.forEach((r,l)=>{const c=t[0],d=`${n}_${c}_${l}`;o.push({depth:e,id:d,key:c,value:l,items:a.length?la(r,a,e+1,d):r,type:"group"})}),o}function ca(i,t){const e=[];for(const n of i)"type"in n&&n.type==="group"?(n.value!=null&&e.push(n),(t.has(n.id)||n.value==null)&&e.push(...ca(n.items,t))):e.push(n);return e}function da(i,t,e){return{flatItems:B(()=>{if(!t.value.length)return i.value;const s=la(i.value,t.value.map(o=>o.key));return ca(s,e.value)})}}const Pl=pt({item:{type:Object,required:!0}},"VDataTableGroupHeaderRow"),Cl=ne()({name:"VDataTableGroupHeaderRow",props:Pl(),setup(i,t){let{slots:e}=t;const{isGroupOpen:n,toggleGroup:s,extractRows:o}=ra(),{isSelected:a,isSomeSelected:r,select:l}=Ji(),{columns:c}=Ki(),d=B(()=>o([i.item]));return()=>b("tr",{class:"v-data-table-group-header-row",style:{"--v-data-table-group-header-row-depth":i.item.depth}},[c.value.map(u=>{var h,f;if(u.key==="data-table-group"){const g=n(i.item)?"$expand":"$next",m=()=>s(i.item);return((h=e["data-table-group"])==null?void 0:h.call(e,{item:i.item,count:d.value.length,props:{icon:g,onClick:m}}))??b(Li,{class:"v-data-table-group-header-row__column"},{default:()=>[b(Ai,{size:"small",variant:"text",icon:g,onClick:m},null),b("span",null,[i.item.value]),b("span",null,[Q("("),d.value.length,Q(")")])]})}if(u.key==="data-table-select"){const g=a(d.value),m=r(d.value)&&!g,p=_=>l(d.value,_);return((f=e["data-table-select"])==null?void 0:f.call(e,{props:{modelValue:g,indeterminate:m,"onUpdate:modelValue":p}}))??b("td",null,[b(En,{modelValue:g,indeterminate:m,"onUpdate:modelValue":p},null)])}return b("td",null,null)})])}}),Dl=pt({expandOnClick:Boolean,showExpand:Boolean,expanded:{type:Array,default:()=>[]}},"DataTable-expand"),ua=Symbol.for("vuetify:datatable:expanded");function ha(i){const t=rt(i,"expandOnClick"),e=ke(i,"expanded",i.expanded,r=>new Set(r),r=>[...r.values()]);function n(r,l){const c=new Set(e.value);l?c.add(r.value):c.delete(r.value),e.value=c}function s(r){return e.value.has(r.value)}function o(r){n(r,!s(r))}const a={expand:n,expanded:e,expandOnClick:t,isExpanded:s,toggleExpand:o};return Ce(ua,a),a}function fa(){const i=De(ua);if(!i)throw new Error("foo");return i}const Tl=pt({index:Number,item:Object,cellProps:[Object,Function],onClick:an(),onContextmenu:an(),onDblclick:an(),...Fn()},"VDataTableRow"),ga=ne()({name:"VDataTableRow",props:Tl(),setup(i,t){let{slots:e}=t;const{displayClasses:n,mobile:s}=Ln(i,"v-data-table__tr"),{isSelected:o,toggleSelect:a,someSelected:r,allSelected:l,selectAll:c}=Ji(),{isExpanded:d,toggleExpand:u}=fa(),{toggleSort:h,sortBy:f,isSorted:g}=ta(),{columns:m}=Ki();pe(()=>b("tr",{class:["v-data-table__tr",{"v-data-table__tr--clickable":!!(i.onClick||i.onContextmenu||i.onDblclick)},n.value],onClick:i.onClick,onContextmenu:i.onContextmenu,onDblclick:i.onDblclick},[i.item&&m.value.map((p,_)=>{const y=i.item,w=`item.${p.key}`,M=`header.${p.key}`,v={index:i.index,item:y.raw,internalItem:y,value:Do(y.columns,p.key),column:p,isSelected:o,toggleSelect:a,isExpanded:d,toggleExpand:u},C={column:p,selectAll:c,isSorted:g,toggleSort:h,sortBy:f.value,someSelected:r.value,allSelected:l.value,getSortIcon:()=>""},P=typeof i.cellProps=="function"?i.cellProps({index:v.index,item:v.item,internalItem:v.internalItem,value:v.value,column:p}):i.cellProps,S=typeof p.cellProps=="function"?p.cellProps({index:v.index,item:v.item,internalItem:v.internalItem,value:v.value}):p.cellProps;return b(Li,et({align:p.align,class:{"v-data-table__td--expanded-row":p.key==="data-table-expand","v-data-table__td--select-row":p.key==="data-table-select"},fixed:p.fixed,fixedOffset:p.fixedOffset,lastFixed:p.lastFixed,maxWidth:s.value?void 0:p.maxWidth,noPadding:p.key==="data-table-select"||p.key==="data-table-expand",nowrap:p.nowrap,width:s.value?void 0:p.width},P,S),{default:()=>{var A,D,I,j,K;if(e[w]&&!s.value)return(A=e[w])==null?void 0:A.call(e,v);if(p.key==="data-table-select")return((D=e["item.data-table-select"])==null?void 0:D.call(e,v))??b(En,{disabled:!y.selectable,modelValue:o([y]),onClick:ss(()=>a(y),["stop"])},null);if(p.key==="data-table-expand")return((I=e["item.data-table-expand"])==null?void 0:I.call(e,v))??b(Ai,{icon:d(y)?"$collapse":"$expand",size:"small",variant:"text",onClick:ss(()=>u(y),["stop"])},null);const k=W(v.value);return s.value?b(vt,null,[b("div",{class:"v-data-table__td-title"},[((j=e[M])==null?void 0:j.call(e,C))??p.title]),b("div",{class:"v-data-table__td-value"},[((K=e[w])==null?void 0:K.call(e,v))??k])]):k}})})]))}}),pa=pt({loading:[Boolean,String],loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideNoData:Boolean,items:{type:Array,default:()=>[]},noDataText:{type:String,default:"$vuetify.noDataText"},rowProps:[Object,Function],cellProps:[Object,Function],...Fn()},"VDataTableRows"),zi=ne()({name:"VDataTableRows",inheritAttrs:!1,props:pa(),setup(i,t){let{attrs:e,slots:n}=t;const{columns:s}=Ki(),{expandOnClick:o,toggleExpand:a,isExpanded:r}=fa(),{isSelected:l,toggleSelect:c}=Ji(),{toggleGroup:d,isGroupOpen:u}=ra(),{t:h}=Xi(),{mobile:f}=Ln(i);return pe(()=>{var g,m;return i.loading&&(!i.items.length||n.loading)?b("tr",{class:"v-data-table-rows-loading",key:"loading"},[b("td",{colspan:s.value.length},[((g=n.loading)==null?void 0:g.call(n))??h(i.loadingText)])]):!i.loading&&!i.items.length&&!i.hideNoData?b("tr",{class:"v-data-table-rows-no-data",key:"no-data"},[b("td",{colspan:s.value.length},[((m=n["no-data"])==null?void 0:m.call(n))??h(i.noDataText)])]):b(vt,null,[i.items.map((p,_)=>{var M;if(p.type==="group"){const v={index:_,item:p,columns:s.value,isExpanded:r,toggleExpand:a,isSelected:l,toggleSelect:c,toggleGroup:d,isGroupOpen:u};return n["group-header"]?n["group-header"](v):b(Cl,et({key:`group-header_${p.id}`,item:p},rs(e,":group-header",()=>v)),n)}const y={index:_,item:p.raw,internalItem:p,columns:s.value,isExpanded:r,toggleExpand:a,isSelected:l,toggleSelect:c},w={...y,props:et({key:`item_${p.key??p.index}`,onClick:o.value?()=>{a(p)}:void 0,index:_,item:p,cellProps:i.cellProps,mobile:f.value},rs(e,":row",()=>y),typeof i.rowProps=="function"?i.rowProps({item:y.item,index:y.index,internalItem:y.internalItem}):i.rowProps)};return b(vt,{key:w.props.key},[n.item?n.item(w):b(ga,w.props,n),r(p)&&((M=n["expanded-row"])==null?void 0:M.call(n,y))])})])}),{}}});const ma=pt({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...Or(),...Ar(),...Ir(),...Rr()},"VTable"),he=ne()({name:"VTable",props:ma(),setup(i,t){let{slots:e,emit:n}=t;const{themeClasses:s}=Fr(i),{densityClasses:o}=Lr(i);return pe(()=>b(i.tag,{class:["v-table",{"v-table--fixed-height":!!i.height,"v-table--fixed-header":i.fixedHeader,"v-table--fixed-footer":i.fixedFooter,"v-table--has-top":!!e.top,"v-table--has-bottom":!!e.bottom,"v-table--hover":i.hover},s.value,o.value,i.class],style:i.style},{default:()=>{var a,r,l;return[(a=e.top)==null?void 0:a.call(e),e.default?b("div",{class:"v-table__wrapper",style:{height:Mt(i.height)}},[b("table",null,[e.default()])]):(r=e.wrapper)==null?void 0:r.call(e),(l=e.bottom)==null?void 0:l.call(e)]}})),{}}}),Ol=pt({items:{type:Array,default:()=>[]},itemValue:{type:[String,Array,Function],default:"id"},itemSelectable:{type:[String,Array,Function],default:null},rowProps:[Object,Function],cellProps:[Object,Function],returnObject:Boolean},"DataTable-items");function Al(i,t,e,n){const s=i.returnObject?t:ci(t,i.itemValue),o=ci(t,i.itemSelectable,!0),a=n.reduce((r,l)=>(l.key!=null&&(r[l.key]=ci(t,l.value)),r),{});return{type:"item",key:i.returnObject?ci(t,i.itemValue):s,index:e,value:s,selectable:o,columns:a,raw:t}}function Il(i,t,e){return t.map((n,s)=>Al(i,n,s,e))}function ba(i,t){return{items:B(()=>Il(i,i.items,t.value))}}function _a(i){let{page:t,itemsPerPage:e,sortBy:n,groupBy:s,search:o}=i;const a=Po("VDataTable"),r=B(()=>({page:t.value,itemsPerPage:e.value,sortBy:n.value,groupBy:s.value,search:o.value}));let l=null;oi(r,()=>{Co(l,r.value)||(l&&l.search!==r.value.search&&(t.value=1),a.emit("update:options",r.value),l=r.value)},{deep:!0,immediate:!0})}const ya=pt({...pa(),hideDefaultBody:Boolean,hideDefaultFooter:Boolean,hideDefaultHeader:Boolean,width:[String,Number],search:String,...Dl(),...na(),...pl(),...Ol(),...wl(),...kl(),...ia(),...ma()},"DataTable"),Rl=pt({...dl(),...ya(),...zo(),...Wo()},"VDataTable"),Fl=ne()({name:"VDataTable",props:Rl(),emits:{"update:modelValue":i=>!0,"update:page":i=>!0,"update:itemsPerPage":i=>!0,"update:sortBy":i=>!0,"update:options":i=>!0,"update:groupBy":i=>!0,"update:expanded":i=>!0,"update:currentItems":i=>!0},setup(i,t){let{attrs:e,slots:n}=t;const{groupBy:s}=oa(i),{sortBy:o,multiSort:a,mustSort:r}=Qo(i),{page:l,itemsPerPage:c}=ul(i),{columns:d,headers:u,sortFunctions:h,sortRawFunctions:f,filterFunctions:g}=Uo(i,{groupBy:s,showSelect:rt(i,"showSelect"),showExpand:rt(i,"showExpand")}),{items:m}=ba(i,d),p=rt(i,"search"),{filteredItems:_}=Bo(i,m,p,{transform:tt=>tt.columns,customKeyFilter:g}),{toggleSort:y}=Zo({sortBy:o,multiSort:a,mustSort:r,page:l}),{sortByWithGroups:w,opened:M,extractRows:v,isGroupOpen:C,toggleGroup:P}=aa({groupBy:s,sortBy:o}),{sortedItems:S}=ea(i,_,w,{transform:tt=>tt.columns,sortFunctions:h,sortRawFunctions:f}),{flatItems:k}=da(S,s,M),A=B(()=>k.value.length),{startIndex:D,stopIndex:I,pageCount:j,setItemsPerPage:K}=hl({page:l,itemsPerPage:c,itemsLength:A}),{paginatedItems:L}=gl({items:k,startIndex:D,stopIndex:I,itemsPerPage:c}),z=B(()=>v(L.value)),{isSelected:$,select:mt,selectAll:it,toggleSelect:It,someSelected:Ut,allSelected:Rt}=Ko(i,{allItems:m,currentPage:z}),{isExpanded:Bt,toggleExpand:Dt}=ha(i);_a({page:l,itemsPerPage:c,sortBy:o,groupBy:s,search:p}),To({VDataTableRows:{hideNoData:rt(i,"hideNoData"),noDataText:rt(i,"noDataText"),loading:rt(i,"loading"),loadingText:rt(i,"loadingText")}});const ot=B(()=>({page:l.value,itemsPerPage:c.value,sortBy:o.value,pageCount:j.value,toggleSort:y,setItemsPerPage:K,someSelected:Ut.value,allSelected:Rt.value,isSelected:$,select:mt,selectAll:it,toggleSelect:It,isExpanded:Bt,toggleExpand:Dt,isGroupOpen:C,toggleGroup:P,items:z.value.map(tt=>tt.raw),internalItems:z.value,groupedItems:L.value,columns:d.value,headers:u.value}));return pe(()=>{const tt=ls.filterProps(i),Tt=Ei.filterProps(i),en=zi.filterProps(i),nn=he.filterProps(i);return b(he,et({class:["v-data-table",{"v-data-table--show-select":i.showSelect,"v-data-table--loading":i.loading},i.class],style:i.style},nn),{top:()=>{var bt;return(bt=n.top)==null?void 0:bt.call(n,ot.value)},default:()=>{var bt,Oe,Ae,Vt,be,Ie;return n.default?n.default(ot.value):b(vt,null,[(bt=n.colgroup)==null?void 0:bt.call(n,ot.value),!i.hideDefaultHeader&&b("thead",{key:"thead"},[b(Ei,Tt,n)]),(Oe=n.thead)==null?void 0:Oe.call(n,ot.value),!i.hideDefaultBody&&b("tbody",null,[(Ae=n["body.prepend"])==null?void 0:Ae.call(n,ot.value),n.body?n.body(ot.value):b(zi,et(e,en,{items:L.value}),n),(Vt=n["body.append"])==null?void 0:Vt.call(n,ot.value)]),(be=n.tbody)==null?void 0:be.call(n,ot.value),(Ie=n.tfoot)==null?void 0:Ie.call(n,ot.value)])},bottom:()=>n.bottom?n.bottom(ot.value):!i.hideDefaultFooter&&b(vt,null,[b(Oo,null,null),b(ls,tt,{prepend:n["footer.prepend"]})])})}),{}}}),Ll=pt({...ya(),...na(),...Kr(),...zo()},"VDataTableVirtual"),xa=ne()({name:"VDataTableVirtual",props:Ll(),emits:{"update:modelValue":i=>!0,"update:sortBy":i=>!0,"update:options":i=>!0,"update:groupBy":i=>!0,"update:expanded":i=>!0},setup(i,t){let{attrs:e,slots:n}=t;const{groupBy:s}=oa(i),{sortBy:o,multiSort:a,mustSort:r}=Qo(i),{columns:l,headers:c,filterFunctions:d,sortFunctions:u,sortRawFunctions:h}=Uo(i,{groupBy:s,showSelect:rt(i,"showSelect"),showExpand:rt(i,"showExpand")}),{items:f}=ba(i,l),g=rt(i,"search"),{filteredItems:m}=Bo(i,f,g,{transform:Tt=>Tt.columns,customKeyFilter:d}),{toggleSort:p}=Zo({sortBy:o,multiSort:a,mustSort:r}),{sortByWithGroups:_,opened:y,extractRows:w,isGroupOpen:M,toggleGroup:v}=aa({groupBy:s,sortBy:o}),{sortedItems:C}=ea(i,m,_,{transform:Tt=>Tt.columns,sortFunctions:u,sortRawFunctions:h}),{flatItems:P}=da(C,s,y),S=B(()=>w(P.value)),{isSelected:k,select:A,selectAll:D,toggleSelect:I,someSelected:j,allSelected:K}=Ko(i,{allItems:S,currentPage:S}),{isExpanded:L,toggleExpand:z}=ha(i),{containerRef:$,markerRef:mt,paddingTop:it,paddingBottom:It,computedItems:Ut,handleItemResize:Rt,handleScroll:Bt,handleScrollend:Dt}=Jr(i,P),ot=B(()=>Ut.value.map(Tt=>Tt.raw));_a({sortBy:o,page:Ii(1),itemsPerPage:Ii(-1),groupBy:s,search:g}),To({VDataTableRows:{hideNoData:rt(i,"hideNoData"),noDataText:rt(i,"noDataText"),loading:rt(i,"loading"),loadingText:rt(i,"loadingText")}});const tt=B(()=>({sortBy:o.value,toggleSort:p,someSelected:j.value,allSelected:K.value,isSelected:k,select:A,selectAll:D,toggleSelect:I,isExpanded:L,toggleExpand:z,isGroupOpen:M,toggleGroup:v,items:S.value.map(Tt=>Tt.raw),internalItems:S.value,groupedItems:P.value,columns:l.value,headers:c.value}));pe(()=>{const Tt=Ei.filterProps(i),en=zi.filterProps(i),nn=he.filterProps(i);return b(he,et({class:["v-data-table",{"v-data-table--loading":i.loading},i.class],style:i.style},nn),{top:()=>{var bt;return(bt=n.top)==null?void 0:bt.call(n,tt.value)},wrapper:()=>{var bt,Oe,Ae;return b("div",{ref:$,onScrollPassive:Bt,onScrollend:Dt,class:"v-table__wrapper",style:{height:Mt(i.height)}},[b("table",null,[(bt=n.colgroup)==null?void 0:bt.call(n,tt.value),!i.hideDefaultHeader&&b("thead",{key:"thead"},[b(Ei,et(Tt,{sticky:i.fixedHeader}),n)]),!i.hideDefaultBody&&b("tbody",null,[b("tr",{ref:mt,style:{height:Mt(it.value),border:0}},[b("td",{colspan:l.value.length,style:{height:0,border:0}},null)]),(Oe=n["body.prepend"])==null?void 0:Oe.call(n,tt.value),b(zi,et(e,en,{items:ot.value}),{...n,item:Vt=>b(Qr,{key:Vt.internalItem.index,renderless:!0,"onUpdate:height":be=>Rt(Vt.internalItem.index,be)},{default:be=>{var is;let{itemRef:Ie}=be;return((is=n.item)==null?void 0:is.call(n,{...Vt,itemRef:Ie}))??b(ga,et(Vt.props,{ref:Ie,key:Vt.internalItem.index,index:Vt.internalItem.index}),n)}})}),(Ae=n["body.append"])==null?void 0:Ae.call(n,tt.value),b("tr",{style:{height:Mt(It.value),border:0}},[b("td",{colspan:l.value.length,style:{height:0,border:0}},null)])])])])},bottom:()=>{var bt;return(bt=n.bottom)==null?void 0:bt.call(n,tt.value)}})})}}),El={components:{PatternCard:qi},props:{activusers:{type:Object,default:{}}},setup(i){const t=[{name:"Frozen Yogurt",calories:159,fat:6,carbs:24,protein:4,iron:1},{name:"Ice cream sandwich",calories:237,fat:9,carbs:37,protein:4.3,iron:1}],e=B({get(){let l=[];return i.activusers.forEach(c=>{let d=l.findIndex(u=>u.user.id==c.user.id);if(d==-1)l.push({user:c.user,info:{count:c.count,session:new Set([c.visitdate]),pages:1},tooltip:[{namepages:c.pages,count:c.count,unic:1}]});else{let u=l[d];u.info.count+=c.count,u.info.session.add(c.visitdate),u.info.pages+=1;let h=u.tooltip.findIndex(f=>f.namepages===c.pages);h==-1?u.tooltip.push({namepages:c.pages,count:c.count,unic:1}):(u.tooltip[h].count+=c.count,u.tooltip[h].unic+=1)}}),l}}),n=J([]);return{checkremote:Er,spravURL:zr,expanded:n,dessertHeaders:[{title:"",align:"",sortable:!1,key:"user"},{title:"просмотры",align:"start",key:"info.count",tooltip:"Количество посещенных страниц за период"},{title:"сессии",align:"start",key:"info.session.size",tooltip:"Сколько дней посещали Портал за период"},{title:"страницы",align:"start",key:"info.pages",tooltip:"Сколько суммарно посещено уникальных страниц за период"}],dataActivusers:e,subtable:[{title:"",align:"start",sortable:!1,key:"namepages",width:"60%",maxWidth:"60%",minWidth:"60%"},{title:"всего",align:"center",key:"count",width:"20%",maxWidth:"20%"},{title:"уникальных",align:"center",key:"unic",width:"20%",maxWidth:"20%"}],getColor:l=>l>100?"green":l>50?"orange":"red",getColor2:l=>l>10?"green":l>5?"orange":"red",desserts:t}}},zl=["colspan"];function Bl(i,t,e,n,s,o){const a=G("list-user"),r=G("pattern-card");return R(),H(r,{title:"Самые активные пользователи",ico:"mdi-star-circle"},{filling:x(()=>[b(xa,{expanded:n.expanded,"onUpdate:expanded":t[0]||(t[0]=l=>n.expanded=l),headers:n.dessertHeaders,items:n.dataActivusers,"item-value":"user","show-expand":"",class:"h-0 cursor-default bg-grey_white","sort-by":[{key:"info.count",order:"desc"}],density:"comfortable"},{"item.user":x(({value:l})=>[b(a,{author:l,from_which:"top-user"},null,8,["author"])]),headers:x(({columns:l,isSorted:c,getSortIcon:d,toggleSort:u})=>[T("tr",null,[(R(!0),ft(vt,null,ee(l,h=>(R(),ft("td",{key:h.key,class:"pa-0 py-2 pb-3"},[h.title!=""?(R(),H(Yt,{key:0,location:"top"},{activator:x(({props:f})=>[b(Ai,et({ref_for:!0},f,{"append-icon":c(h)?d(h):"",variant:"text",class:"text-caption",onClick:()=>u(h)}),{append:x(()=>[b(wt,{size:"x-small"})]),default:x(()=>[Q(W(h.title)+" ",1)]),_:2},1040,["append-icon","onClick"])]),default:x(()=>[T("span",null,W(h.tooltip),1)]),_:2},1024)):Qe("",!0)]))),128))])]),"expanded-row":x(({columns:l,item:c})=>[T("tr",null,[T("td",{colspan:l.length},[b(ge,{class:"my-2 elevation-0",color:"grey"},{default:x(()=>[b(Oo),b(Fl,{headers:n.subtable,items:c.tooltip,"items-per-page":"-1",class:"subtable cursor-default px-3 bg-grey-lighten-5 text-body-2",density:"compact","sort-by":[{key:"count",order:"desc"}]},{headers:x(({columns:d,isSorted:u,getSortIcon:h,toggleSort:f})=>[T("tr",null,[(R(!0),ft(vt,null,ee(d,g=>(R(),ft("td",{key:g.key,class:"pa-0"},[b(Ai,{"append-icon":u(g)?h(g):"",variant:"text",class:"text-caption",onClick:()=>f(g)},{append:x(()=>[b(wt,{size:"x-small"})]),default:x(()=>[Q(W(g.title)+" ",1)]),_:2},1032,["append-icon","onClick"])]))),128))])]),"item.count":x(({value:d})=>[T("span",{class:qt(["text-"+n.getColor2(d),"font-weight-medium text-subtitle-2"])},W(d),3)]),"item.unic":x(({value:d})=>[T("span",{class:qt(["text-"+n.getColor(d),"font-weight-medium text-subtitle-2"])},W(d),3)]),_:2},1032,["headers","items"])]),_:2},1024)],8,zl)])]),_:1},8,["expanded","headers","items"])]),_:1})}const va=ut(El,[["render",Bl]]),Vl={props:{title:{type:String,default:""}}},Hl={class:"font-weight-medium text-button text-teal-darken-4 cursor-default"};function Wl(i,t,e,n,s,o){return R(),H(ge,{class:"h-100 d-flex",variant:"flat"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{class:"flex-grow-0 bg-teal-lighten-5 pa-0 w100"},{default:x(()=>[T("span",Hl,W(e.title),1)]),_:1}),b(F,{class:"d-flex flex-column pa-0"},{default:x(()=>[So(i.$slots,"filling_feedback")]),_:3})]),_:3})]),_:3})}const Bn=ut(Vl,[["render",Wl]]),Nl={components:{PatternCardFeed:Bn},props:{data:{type:Object,default:()=>{}}}},jl=T("thead",null,[T("tr",null,[T("th",{class:"text-center text-subtitle-1 font-weight-regular"}," всего "),T("th",{class:"text-center text-subtitle-1 font-weight-regular"}," за период ")])],-1),$l={class:"text-center text-h6 font-weight-bold"},Yl={class:"text-center text-h6 font-weight-bold"};function Ul(i,t,e,n,s,o){const a=G("pattern-card-feed");return R(),H(a,{title:e.data.title},{filling_feedback:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,null,{default:x(()=>[b(he,{density:"compact",class:"px-7"},{default:x(()=>[jl,T("tbody",null,[T("tr",null,[T("th",$l,W(e.data.all),1),T("th",Yl,W(e.data.period),1)])])]),_:1})]),_:1})]),_:1})]),_:1},8,["title"])}const Xl=ut(Nl,[["render",Ul]]),Gl={props:{comment:{type:Object,default:()=>{}}},setup(){return{formaComaTime:Ao}}};function ql(i,t,e,n,s,o){return R(),H(ge,{"max-width":"400",density:"compact",class:"bg-transparent"},{default:x(()=>[b(_n,{class:"pb-0"},{default:x(()=>[Q("Оставлено комментариев")]),_:1}),b(Br,null,{default:x(()=>[Q("Последний комментарий оставлен "+W(n.formaComaTime(e.comment.time_create)),1)]),_:1}),b(_n,{class:"text-caption"},{default:x(()=>[Q(W(e.comment.comment),1)]),_:1})]),_:1})}const Kl=ut(Gl,[["render",ql]]),Jl={components:{PatternCardFeed:Bn,TooltipText:Io,CardComment:Kl},props:{top:{type:Object,default:()=>{}}}},Ql={class:"text-center text-caption font-weight-medium"},Zl={class:"text-center text-caption font-weight-medium"},tc={class:"text-center text-h6 font-weight-bold"},ec={class:"text-center text-h6 font-weight-bold"};function ic(i,t,e,n,s,o){const a=G("list-user"),r=G("card-comment"),l=G("pattern-card-feed");return R(),H(l,{title:"Самый активный критик"},{filling_feedback:x(()=>[e.top.comment[0].time_create!="1990-01-01"?(R(),H(U,{key:0,"no-gutters":""},{default:x(()=>[b(F,{lg:"5",class:"bg-teal-lighten-4 align-self-center"},{default:x(()=>[b(a,{author:e.top.author,from_which:"top_comment"},null,8,["author"])]),_:1}),b(F,{class:"align-self-center pl-0"},{default:x(()=>[b(he,{density:"compact",class:"pa-0"},{default:x(()=>[T("thead",null,[T("tr",null,[T("th",Ql,[b(Yt,{location:"top"},{activator:x(({props:c})=>[T("span",Ri(Fi(c)),[b(wt,{class:"cursor-help",icon:"mdi-comment-text-outline",color:"cyan-darken-4",size:"x-large"})],16)]),default:x(()=>[b(r,{comment:e.top.comment[0]},null,8,["comment"])]),_:1})]),T("th",Zl,[b(Yt,{location:"top"},{activator:x(({props:c})=>[T("span",Ri(Fi(c)),[b(wt,{class:"cursor-help",icon:"mdi-star",color:"orange",size:"x-large"})],16)]),default:x(()=>[Q(" Поставлено оценок ")]),_:1})])])]),T("tbody",null,[T("tr",null,[T("th",tc,W(e.top.comment.length),1),T("th",ec,W(e.top.score),1)])])]),_:1})]),_:1})]),_:1})):(R(),H(U,{key:1,class:"align-center flex-column gap mt-n2","no-gutters":""},{default:x(()=>[b(F,{class:"text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" За выбранный период комментариев нет ")]),_:1})]),_:1}))]),_:1})}const nc=ut(Jl,[["render",ic]]),sc={props:{rating:{type:Object,default:()=>{}}},components:{PatternCardFeed:Bn},setup(i){return{avgcriteria:B({get(){let e=0;return i.rating.forEach(n=>{e+=n.ratings}),parseFloat(e/i.rating.length).toFixed(2)}})}}},oc={key:0,class:"pt-1"},ac={key:1,class:"d-flex flex-column"};function rc(i,t,e,n,s,o){const a=G("pattern-card-feed");return R(),H(a,{title:"Средняя оценка"},{filling_feedback:x(()=>[e.rating.length!=0?(R(),ft("div",oc,[b(U,{"no-gutters":""},{default:x(()=>[b(F,{class:"text-h4 font-weight-medium"},{default:x(()=>[Q(W(n.avgcriteria),1)]),_:1})]),_:1}),b(U,{class:"align-center flex-column scoreheight","no-gutters":""},{default:x(()=>[(R(!0),ft(vt,null,ee(e.rating,(r,l)=>(R(),ft("div",{class:"flex-column d-flex pa-0",key:l},[b(F,{lg:"1",class:"text-subtitle-1 font-weight-regular cursor-default w100 pa-0"},{default:x(()=>[b(Yt,{text:r.name,location:"left"},{activator:x(({props:c})=>[b(wt,et({class:"pb-4 pr-3",ref_for:!0},c,{size:"small",color:r.color,icon:r.ico}),null,16,["color","icon"])]),_:2},1032,["text"]),b(Zr,{modelValue:r.ratings,"onUpdate:modelValue":c=>r.ratings=c,hover:typeof l=="number","half-increments":"",readonly:"",size:25,color:"yellow",density:"comfortable"},null,8,["modelValue","onUpdate:modelValue","hover"])]),_:2},1024)]))),128))]),_:1})])):(R(),ft("div",ac,[b(U,{class:"align-center flex-column scoreheight gap mt-n2","no-gutters":""},{default:x(()=>[b(F,{class:"text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" За выбранный период оценок нет ")]),_:1})]),_:1})]))]),_:1})}const lc=ut(sc,[["render",rc]]),cc={components:{CardTotal:Vo,TopUser:va,PatternCard:qi,CardFeedback:Xl,CardTopComment:nc,FeedstarLike:tl,StatistikLike:lc},props:{feedback:{type:Object,default:()=>({feed:[],last_comment:{time_create:"1990-01-01"}})}},setup(i){const t=B({get(){let e={},n={comment:[{time_create:"1990-01-01",comment:""}],score:0};if(i.feedback.feed.forEach(s=>{e[s.author.id]||(e[s.author.id]=0),e[s.author.id]+=1}),Object.keys(e).length>0){let s=Object.keys(e).reduce((a,r)=>e[a]>e[r]?a:r),o=i.feedback.feed.filter(a=>a.author.id==s);n=Object.assign({},o[o.length-1]),n.fio=Kt(n.author),n.score=o.length,n.comment=o.filter(a=>a.comment.length>0).sort((a,r)=>r.id-a.id)}return n}});return{formaComaTime:Ao,dataTopUser:t}}},dc=T("br",null,null,-1),uc={class:"text-subtitle-1 font-weight-bold"};function hc(i,t,e,n,s,o){const a=G("statistik-like"),r=G("card-feedback"),l=G("card-top-comment"),c=G("pattern-card");return R(),H(c,{title:"Обратная связь",ico:"mdi-comment-multiple-outline"},{filling:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{lg:"1",class:"w100"},{default:x(()=>[b(ge,{variant:"flat",class:"text-subtitle-1 font-weight-regular cursor-default"},{default:x(()=>[Q(" Последний комментарий оставлен: "),dc,Q(),T("span",uc,W(n.formaComaTime(e.feedback.last_comment.time_create)),1)]),_:1})]),_:1}),b(F,{lg:"2",class:"w100"},{default:x(()=>[b(a,{rating:e.feedback.criteria},null,8,["rating"])]),_:1}),(R(!0),ft(vt,null,ee(e.feedback.data,d=>(R(),H(F,{class:"w100 flex-grow-0",key:d},{default:x(()=>[b(r,{data:d},null,8,["data"])]),_:2},1024))),128)),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(l,{top:n.dataTopUser},null,8,["top"])]),_:1})]),_:1})]),_:1})}const fc=ut(cc,[["render",hc]]);const gc={props:{datedefault:{type:Date,default:""}},setup(i,{emit:t}){const e=Vr();Ot(new Date);const n=J(!1),s=J(null);return{menudate:n,selectedDate:s,dateStart:()=>{t("returndate",s.value),n.value=!1},formatComa:Ro,formatDash:Ot,appStore:e}}};function pc(i,t,e,n,s,o){return R(),H(Hr,{modelValue:n.menudate,"onUpdate:modelValue":t[2]||(t[2]=a=>n.menudate=a),"close-on-content-click":!1,"nudge-right":40,transition:"scale-transition","offset-y":""},{activator:x(({props:a})=>[b(il,et({modelValue:n.selectedDate,"onUpdate:modelValue":t[0]||(t[0]=r=>n.selectedDate=r),value:n.formatComa(e.datedefault),"no-resize":"",class:"my-textarea",rows:"1","hide-details":"",style:{width:"119px"},variant:"plain",density:"compact"},a),{"prepend-inner":x(()=>[b(wt,et(a,{icon:"mdi-calendar-today",color:"cyan-darken-3",size:"x-small"}),null,16)]),_:2},1040,["modelValue","value"])]),default:x(()=>[b(qr,{locale:"ru"},{default:x(()=>[b(Gr,{modelValue:n.selectedDate,"onUpdate:modelValue":[t[1]||(t[1]=a=>n.selectedDate=a),n.dateStart],"show-adjacent-months":"","hide-header":"",border:"",max:n.formatDash(new Date),min:n.formatDash(n.appStore.countvisitor.visitdate)},null,8,["modelValue","onUpdate:modelValue","max","min"])]),_:1})]),_:1},8,["modelValue"])}const wa=ut(gc,[["render",pc]]);/*! +var yr=Object.defineProperty;var xr=(i,t,e)=>t in i?yr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var O=(i,t,e)=>(xr(i,typeof t!="symbol"?t+"":t,e),e);import{d5 as vr,d as wr,r as J,_ as ut,Q as G,s as R,t as H,v as x,x as b,E as F,y as Q,$ as W,a4 as Yt,V as wt,z as et,M as T,D as U,R as ft,K as ge,cS as ko,C as _n,c3 as So,a7 as pt,ak as ke,f as z,ao as Mo,p as Ce,d6 as Po,w as oi,k as De,ai as sn,ab as ne,d7 as Xi,af as pe,d8 as kr,at as Mt,b8 as Sr,d9 as Mr,da as Co,db as on,an as rt,dc as li,c$ as ns,ay as Fn,dd as Pr,de as Cr,aC as Dr,aE as Ln,df as Tr,S as vt,dg as Do,A as Ai,dh as an,cG as ss,a8 as Or,di as Ar,aq as Ir,aa as Rr,ac as Fr,dj as Lr,dk as ci,aJ as To,Z as Oo,ah as Ii,O as Er,P as Br,T as ee,aP as qt,a0 as Qe,dl as Ao,cT as zr,dm as Io,bN as Ri,by as Fi,dn as Kt,m as Vr,dp as Ot,a2 as Ro,cR as Hr,bk as Fo,bz as yn,cz as Wr,q as Nr,e as jr,ci as xn,n as $r,bG as Lo,dq as at,dr as os,cV as Yr,U as Ur,ds as Xr}from"./index-f3f24177.js";import{V as as}from"./VPagination-e7082dac.js";import{V as Eo}from"./VSelect-9ace525e.js";import{V as En}from"./VCheckboxBtn-53ca7935.js";import{m as Bo,u as zo,V as Gr}from"./VDatePicker-783de65a.js";import{m as qr,u as Kr,V as Jr}from"./VVirtualScroll-82048add.js";import{V as Qr,F as Zr}from"./feedstar-like-d1c3d07c.js";import{V as tl}from"./VTextarea-d04410cf.js";import{V as el}from"./VLocaleProvider-7ac59f8a.js";import{V as il}from"./VToolbar-b8510e35.js";import{V as nl}from"./VSwitch-1c98fb5a.js";import"./VTextField-2c3c89ba.js";/* empty css */import"./VField-ac1e4507.js";import"./VInput-3de7b4b2.js";import"./VList-983e49dd.js";import"./ssrBoot-4527a6ac.js";import"./VSelectionControl-9e0e68f5.js";import"./VSpacer-9ba25539.js";function rs(i,t,e){return Object.keys(i).filter(n=>vr(n)&&n.endsWith(t)).reduce((n,s)=>(n[s.slice(0,-t.length)]=o=>i[s](o,e(o)),n),{})}const Gi=wr("filter",()=>({date_period:J({startdate:new Date(new Date().getFullYear(),0,1),enddate:new Date})})),sl={props:{indicator:{type:Object,default:{}}}},ol={class:"text-caption"},al={key:1};function rl(i,t,e,n,s,o){const a=G("vue3-autocounter");return R(),H(ge,{class:"text-center text-blue-grey-darken-4 d-flex h-100 flex-column cursor-default justify-center"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"text-h5 font-weight-bold pl-5"},{default:x(()=>[Q(W(e.indicator.title)+" ",1),b(Yt,{width:"250"},{activator:x(({props:r})=>[b(wt,et({icon:"mdi-information",color:"cyan-darken-3",size:"12"},r,{class:"align-self-end pr-2 pb-5 cursor-help"}),null,16)]),default:x(()=>[T("span",ol,W(e.indicator.tooltip),1)]),_:1})]),_:1})]),_:1}),b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"text-h6 font-weight-medium"},{default:x(()=>[Q(W(e.indicator.abb),1)]),_:1})]),_:1}),b(U,{"no-gutters":"",class:"flex-grow-0 pt-3"},{default:x(()=>[b(F,{class:"text-h3 text-grey-darken-3 text-center font-weight-regular align-self-center"},{default:x(()=>[Number.isNaN(e.indicator.data)?(R(),ft("div",al,[b(U,null,{default:x(()=>[b(F,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" Данных нет ")]),_:1})]),_:1})])):(R(),H(a,{key:0,ref:"counter",startAmount:0,endAmount:e.indicator.data,duration:1,decimals:Number.isInteger(e.indicator.data)?0:2,suffix:e.indicator.abb=="(PPV)"?"":"%"},null,8,["endAmount","decimals","suffix"]))]),_:1})]),_:1})]),_:1})}const Vo=ut(sl,[["render",rl]]),ll={props:{title:{type:String,default:""},ico:{type:String,default:""}}};function cl(i,t,e,n,s,o){return R(),H(ge,{class:"text-center h-100 d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-grow-0"},{default:x(()=>[b(F,{class:"d-flex flex-column pa-1"},{default:x(()=>[b(ko,{color:"light-blue-darken-4",label:"",class:"text-center text-cyan-darken-4 rounded-0 text-subtitle-1 font-weight-medium"},{default:x(()=>[b(wt,{start:"",color:"cyan-darken-4",icon:e.ico},null,8,["icon"]),Q(" "+W(e.title),1)]),_:1})]),_:1})]),_:1}),b(U,{"no-gutters":""},{default:x(()=>[b(F,{class:"flex-column d-flex"},{default:x(()=>[b(_n,{class:"px-3 py-1 flex-column d-flex h-0 overflow-x-auto overflow-x-hidden"},{default:x(()=>[So(i.$slots,"filling")]),_:3})]),_:3})]),_:3})]),_:3})}const qi=ut(ll,[["render",cl]]);const dl=pt({page:{type:[Number,String],default:1},itemsPerPage:{type:[Number,String],default:10}},"DataTable-paginate"),Ho=Symbol.for("vuetify:data-table-pagination");function ul(i){const t=ke(i,"page",void 0,n=>+(n??1)),e=ke(i,"itemsPerPage",void 0,n=>+(n??10));return{page:t,itemsPerPage:e}}function hl(i){const{page:t,itemsPerPage:e,itemsLength:n}=i,s=z(()=>e.value===-1?0:e.value*(t.value-1)),o=z(()=>e.value===-1?n.value:Math.min(n.value,s.value+e.value)),a=z(()=>e.value===-1||n.value===0?1:Math.ceil(n.value/e.value));Mo(()=>{t.value>a.value&&(t.value=a.value)});function r(h){e.value=h,t.value=1}function l(){t.value=sn(t.value+1,1,a.value)}function c(){t.value=sn(t.value-1,1,a.value)}function d(h){t.value=sn(h,1,a.value)}const u={page:t,itemsPerPage:e,startIndex:s,stopIndex:o,pageCount:a,itemsLength:n,nextPage:l,prevPage:c,setPage:d,setItemsPerPage:r};return Ce(Ho,u),u}function fl(){const i=De(Ho);if(!i)throw new Error("Missing pagination!");return i}function gl(i){const t=Po("usePaginatedItems"),{items:e,startIndex:n,stopIndex:s,itemsPerPage:o}=i,a=z(()=>o.value<=0?e.value:e.value.slice(n.value,s.value));return oi(a,r=>{t.emit("update:currentItems",r)}),{paginatedItems:a}}const Wo=pt({prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},pageText:{type:String,default:"$vuetify.dataFooter.pageText"},firstPageLabel:{type:String,default:"$vuetify.dataFooter.firstPage"},prevPageLabel:{type:String,default:"$vuetify.dataFooter.prevPage"},nextPageLabel:{type:String,default:"$vuetify.dataFooter.nextPage"},lastPageLabel:{type:String,default:"$vuetify.dataFooter.lastPage"},itemsPerPageOptions:{type:Array,default:()=>[{value:10,title:"10"},{value:25,title:"25"},{value:50,title:"50"},{value:100,title:"100"},{value:-1,title:"$vuetify.dataFooter.itemsPerPageAll"}]},showCurrentPage:Boolean},"VDataTableFooter"),ls=ne()({name:"VDataTableFooter",props:Wo(),setup(i,t){let{slots:e}=t;const{t:n}=Xi(),{page:s,pageCount:o,startIndex:a,stopIndex:r,itemsLength:l,itemsPerPage:c,setItemsPerPage:d}=fl(),u=z(()=>i.itemsPerPageOptions.map(h=>typeof h=="number"?{value:h,title:h===-1?n("$vuetify.dataFooter.itemsPerPageAll"):String(h)}:{...h,title:isNaN(Number(h.title))?n(h.title):h.title}));return pe(()=>{var f;const h=as.filterProps(i);return b("div",{class:"v-data-table-footer"},[(f=e.prepend)==null?void 0:f.call(e),b("div",{class:"v-data-table-footer__items-per-page"},[b("span",null,[n(i.itemsPerPageText)]),b(Eo,{items:u.value,modelValue:c.value,"onUpdate:modelValue":g=>d(Number(g)),density:"compact",variant:"outlined","hide-details":!0},null)]),b("div",{class:"v-data-table-footer__info"},[b("div",null,[n(i.pageText,l.value?a.value+1:0,r.value,l.value)])]),b("div",{class:"v-data-table-footer__pagination"},[b(as,et({modelValue:s.value,"onUpdate:modelValue":g=>s.value=g,density:"comfortable","first-aria-label":i.firstPageLabel,"last-aria-label":i.lastPageLabel,length:o.value,"next-aria-label":i.nextPageLabel,"previous-aria-label":i.prevPageLabel,rounded:!0,"show-first-last-page":!0,"total-visible":i.showCurrentPage?1:0,variant:"plain"},h),null)])])}),{}}}),Li=kr({align:{type:String,default:"start"},fixed:Boolean,fixedOffset:[Number,String],height:[Number,String],lastFixed:Boolean,noPadding:Boolean,tag:String,width:[Number,String],maxWidth:[Number,String],nowrap:Boolean},(i,t)=>{let{slots:e}=t;const n=i.tag??"td";return b(n,{class:["v-data-table__td",{"v-data-table-column--fixed":i.fixed,"v-data-table-column--last-fixed":i.lastFixed,"v-data-table-column--no-padding":i.noPadding,"v-data-table-column--nowrap":i.nowrap},`v-data-table-column--align-${i.align}`],style:{height:Mt(i.height),width:Mt(i.width),maxWidth:Mt(i.maxWidth),left:Mt(i.fixedOffset||null)}},{default:()=>{var s;return[(s=e.default)==null?void 0:s.call(e)]}})}),pl=pt({headers:Array},"DataTable-header"),No=Symbol.for("vuetify:data-table-headers"),jo={title:"",sortable:!1},ml={...jo,width:48};function bl(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(e=>({element:e,priority:0}));return{enqueue:(e,n)=>{let s=!1;for(let o=0;on){t.splice(o,0,{element:e,priority:n}),s=!0;break}s||t.push({element:e,priority:n})},size:()=>t.length,count:()=>{let e=0;if(!t.length)return 0;const n=Math.floor(t[0].priority);for(let s=0;st.shift()}}function vn(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(!i.children)t.push(i);else for(const e of i.children)vn(e,t);return t}function $o(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;for(const e of i)e.key&&t.add(e.key),e.children&&$o(e.children,t);return t}function _l(i){if(i.key){if(i.key==="data-table-group")return jo;if(["data-table-expand","data-table-select"].includes(i.key))return ml}}function Bn(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return i.children?Math.max(t,...i.children.map(e=>Bn(e,t+1))):t}function yl(i){let t=!1;function e(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(o)if(a&&(o.fixed=!0),o.fixed)if(o.children)for(let r=o.children.length-1;r>=0;r--)e(o.children[r],!0);else t?isNaN(+o.width)&&Mr(`Multiple fixed columns should have a static width (key: ${o.key})`):o.lastFixed=!0,t=!0;else if(o.children)for(let r=o.children.length-1;r>=0;r--)e(o.children[r]);else t=!1}for(let o=i.length-1;o>=0;o--)e(i[o]);function n(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!o)return a;if(o.children){o.fixedOffset=a;for(const r of o.children)a=n(r,a)}else o.fixed&&(o.fixedOffset=a,a+=parseFloat(o.width||"0")||0);return a}let s=0;for(const o of i)s=n(o,s)}function xl(i,t){const e=[];let n=0;const s=bl(i);for(;s.size()>0;){let a=s.count();const r=[];let l=1;for(;a>0;){const{element:c,priority:d}=s.dequeue(),u=t-n-Bn(c);if(r.push({...c,rowspan:u??1,colspan:c.children?vn(c).length:1}),c.children)for(const h of c.children){const f=d%1+l/Math.pow(10,n+2);s.enqueue(h,n+u+f)}l+=1,a-=1}n+=1,e.push(r)}return{columns:i.map(a=>vn(a)).flat(),headers:e}}function Yo(i){const t=[];for(const e of i){const n={..._l(e),...e},s=n.key??(typeof n.value=="string"?n.value:null),o=n.value??s??null,a={...n,key:s,value:o,sortable:n.sortable??(n.key!=null||!!n.sort),children:n.children?Yo(n.children):void 0};t.push(a)}return t}function Uo(i,t){const e=J([]),n=J([]),s=J({}),o=J({}),a=J({});Mo(()=>{var m,p,_;const c=(i.headers||Object.keys(i.items[0]??{}).map(y=>({key:y,title:Sr(y)}))).slice(),d=$o(c);(m=t==null?void 0:t.groupBy)!=null&&m.value.length&&!d.has("data-table-group")&&c.unshift({key:"data-table-group",title:"Group"}),(p=t==null?void 0:t.showSelect)!=null&&p.value&&!d.has("data-table-select")&&c.unshift({key:"data-table-select"}),(_=t==null?void 0:t.showExpand)!=null&&_.value&&!d.has("data-table-expand")&&c.push({key:"data-table-expand"});const u=Yo(c);yl(u);const h=Math.max(...u.map(y=>Bn(y)))+1,f=xl(u,h);e.value=f.headers,n.value=f.columns;const g=f.headers.flat(1);for(const y of g)y.key&&(y.sortable&&(y.sort&&(s.value[y.key]=y.sort),y.sortRaw&&(o.value[y.key]=y.sortRaw)),y.filter&&(a.value[y.key]=y.filter))});const r={headers:e,columns:n,sortFunctions:s,sortRawFunctions:o,filterFunctions:a};return Ce(No,r),r}function Ki(){const i=De(No);if(!i)throw new Error("Missing headers!");return i}const vl={showSelectAll:!1,allSelected:()=>[],select:i=>{var n;let{items:t,value:e}=i;return new Set(e?[(n=t[0])==null?void 0:n.value]:[])},selectAll:i=>{let{selected:t}=i;return t}},Xo={showSelectAll:!0,allSelected:i=>{let{currentPage:t}=i;return t},select:i=>{let{items:t,value:e,selected:n}=i;for(const s of t)e?n.add(s.value):n.delete(s.value);return n},selectAll:i=>{let{value:t,currentPage:e,selected:n}=i;return Xo.select({items:e,value:t,selected:n})}},Go={showSelectAll:!0,allSelected:i=>{let{allItems:t}=i;return t},select:i=>{let{items:t,value:e,selected:n}=i;for(const s of t)e?n.add(s.value):n.delete(s.value);return n},selectAll:i=>{let{value:t,allItems:e,selected:n}=i;return Go.select({items:e,value:t,selected:n})}},wl=pt({showSelect:Boolean,selectStrategy:{type:[String,Object],default:"page"},modelValue:{type:Array,default:()=>[]},valueComparator:{type:Function,default:Co}},"DataTable-select"),qo=Symbol.for("vuetify:data-table-selection");function Ko(i,t){let{allItems:e,currentPage:n}=t;const s=ke(i,"modelValue",i.modelValue,_=>new Set(on(_).map(y=>{var w;return((w=e.value.find(M=>i.valueComparator(y,M.value)))==null?void 0:w.value)??y})),_=>[..._.values()]),o=z(()=>e.value.filter(_=>_.selectable)),a=z(()=>n.value.filter(_=>_.selectable)),r=z(()=>{if(typeof i.selectStrategy=="object")return i.selectStrategy;switch(i.selectStrategy){case"single":return vl;case"all":return Go;case"page":default:return Xo}});function l(_){return on(_).every(y=>s.value.has(y.value))}function c(_){return on(_).some(y=>s.value.has(y.value))}function d(_,y){const w=r.value.select({items:_,value:y,selected:new Set(s.value)});s.value=w}function u(_){d([_],!l([_]))}function h(_){const y=r.value.selectAll({value:_,allItems:o.value,currentPage:a.value,selected:new Set(s.value)});s.value=y}const f=z(()=>s.value.size>0),g=z(()=>{const _=r.value.allSelected({allItems:o.value,currentPage:a.value});return!!_.length&&l(_)}),m=z(()=>r.value.showSelectAll),p={toggleSelect:u,select:d,selectAll:h,isSelected:l,isSomeSelected:c,someSelected:f,allSelected:g,showSelectAll:m};return Ce(qo,p),p}function Ji(){const i=De(qo);if(!i)throw new Error("Missing selection!");return i}const kl=pt({sortBy:{type:Array,default:()=>[]},customKeySort:Object,multiSort:Boolean,mustSort:Boolean},"DataTable-sort"),Jo=Symbol.for("vuetify:data-table-sort");function Qo(i){const t=ke(i,"sortBy"),e=rt(i,"mustSort"),n=rt(i,"multiSort");return{sortBy:t,mustSort:e,multiSort:n}}function Zo(i){const{sortBy:t,mustSort:e,multiSort:n,page:s}=i,o=l=>{if(l.key==null)return;let c=t.value.map(u=>({...u}))??[];const d=c.find(u=>u.key===l.key);d?d.order==="desc"?e.value?d.order="asc":c=c.filter(u=>u.key!==l.key):d.order="desc":n.value?c=[...c,{key:l.key,order:"asc"}]:c=[{key:l.key,order:"asc"}],t.value=c,s&&(s.value=1)};function a(l){return!!t.value.find(c=>c.key===l.key)}const r={sortBy:t,toggleSort:o,isSorted:a};return Ce(Jo,r),r}function ta(){const i=De(Jo);if(!i)throw new Error("Missing sort!");return i}function ea(i,t,e,n){const s=Xi();return{sortedItems:z(()=>{var a,r;return!e.value.length||i.disableSort?t.value:Sl(t.value,e.value,s.current.value,{transform:n==null?void 0:n.transform,sortFunctions:{...i.customKeySort,...(a=n==null?void 0:n.sortFunctions)==null?void 0:a.value},sortRawFunctions:(r=n==null?void 0:n.sortRawFunctions)==null?void 0:r.value})})}}function Sl(i,t,e,n){const s=new Intl.Collator(e,{sensitivity:"accent",usage:"sort"});return i.map(a=>[a,n!=null&&n.transform?n.transform(a):a]).sort((a,r)=>{var l,c;for(let d=0;dy!=null?y.toString().toLocaleLowerCase():y),g!==m)return li(g)&&li(m)?0:li(g)?-1:li(m)?1:!isNaN(g)&&!isNaN(m)?Number(g)-Number(m):s.compare(g,m)}}return 0}).map(a=>{let[r]=a;return r})}const ia=pt({color:String,sticky:Boolean,disableSort:Boolean,multiSort:Boolean,sortAscIcon:{type:ns,default:"$sortAsc"},sortDescIcon:{type:ns,default:"$sortDesc"},headerProps:{type:Object},...Fn(),...Pr()},"VDataTableHeaders"),Ei=ne()({name:"VDataTableHeaders",props:ia(),setup(i,t){let{slots:e}=t;const{t:n}=Xi(),{toggleSort:s,sortBy:o,isSorted:a}=ta(),{someSelected:r,allSelected:l,selectAll:c,showSelectAll:d}=Ji(),{columns:u,headers:h}=Ki(),{loaderClasses:f}=Cr(i);function g(S,k){if(!(!i.sticky&&!S.fixed))return{position:"sticky",left:S.fixed?Mt(S.fixedOffset):void 0,top:i.sticky?`calc(var(--v-table-header-height) * ${k})`:void 0}}function m(S){const k=o.value.find(A=>A.key===S.key);return k?k.order==="asc"?i.sortAscIcon:i.sortDescIcon:i.sortAscIcon}const{backgroundColorClasses:p,backgroundColorStyles:_}=Dr(i,"color"),{displayClasses:y,mobile:w}=Ln(i),M=z(()=>({headers:h.value,columns:u.value,toggleSort:s,isSorted:a,sortBy:o.value,someSelected:r.value,allSelected:l.value,selectAll:c,getSortIcon:m})),v=z(()=>["v-data-table__th",{"v-data-table__th--sticky":i.sticky},y.value,f.value]),C=S=>{let{column:k,x:A,y:D}=S;const I=k.key==="data-table-select"||k.key==="data-table-expand",j=et(i.headerProps??{},k.headerProps??{});return b(Li,et({tag:"th",align:k.align,class:[{"v-data-table__th--sortable":k.sortable&&!i.disableSort,"v-data-table__th--sorted":a(k),"v-data-table__th--fixed":k.fixed},...v.value],style:{width:Mt(k.width),minWidth:Mt(k.minWidth),maxWidth:Mt(k.maxWidth),...g(k,D)},colspan:k.colspan,rowspan:k.rowspan,onClick:k.sortable?()=>s(k):void 0,fixed:k.fixed,nowrap:k.nowrap,lastFixed:k.lastFixed,noPadding:I},j),{default:()=>{var B;const K=`header.${k.key}`,L={column:k,selectAll:c,isSorted:a,toggleSort:s,sortBy:o.value,someSelected:r.value,allSelected:l.value,getSortIcon:m};return e[K]?e[K](L):k.key==="data-table-select"?((B=e["header.data-table-select"])==null?void 0:B.call(e,L))??(d.value&&b(En,{modelValue:l.value,indeterminate:r.value&&!l.value,"onUpdate:modelValue":c},null)):b("div",{class:"v-data-table-header__content"},[b("span",null,[k.title]),k.sortable&&!i.disableSort&&b(wt,{key:"icon",class:"v-data-table-header__sort-icon",icon:m(k)},null),i.multiSort&&a(k)&&b("div",{key:"badge",class:["v-data-table-header__sort-badge",...p.value],style:_.value},[o.value.findIndex($=>$.key===k.key)+1])])}})},P=()=>{const S=et(i.headerProps??{}??{}),k=z(()=>u.value.filter(D=>(D==null?void 0:D.sortable)&&!i.disableSort)),A=z(()=>{if(u.value.find(I=>I.key==="data-table-select")!=null)return l.value?"$checkboxOn":r.value?"$checkboxIndeterminate":"$checkboxOff"});return b(Li,et({tag:"th",class:[...v.value],colspan:h.value.length+1},S),{default:()=>[b("div",{class:"v-data-table-header__content"},[b(Eo,{chips:!0,class:"v-data-table__td-sort-select",clearable:!0,density:"default",items:k.value,label:n("$vuetify.dataTable.sortBy"),multiple:i.multiSort,variant:"underlined","onClick:clear":()=>o.value=[],appendIcon:A.value,"onClick:append":()=>c(!l.value)},{...e,chip:D=>{var I;return b(ko,{onClick:(I=D.item.raw)!=null&&I.sortable?()=>s(D.item.raw):void 0,onMousedown:j=>{j.preventDefault(),j.stopPropagation()}},{default:()=>[D.item.title,b(wt,{class:["v-data-table__td-sort-icon",a(D.item.raw)&&"v-data-table__td-sort-icon-active"],icon:m(D.item.raw),size:"small"},null)]})}})])]})};pe(()=>w.value?b("tr",null,[b(P,null,null)]):b(vt,null,[e.headers?e.headers(M.value):h.value.map((S,k)=>b("tr",null,[S.map((A,D)=>b(C,{column:A,x:D,y:k},null))])),i.loading&&b("tr",{class:"v-data-table-progress"},[b("th",{colspan:u.value.length},[b(Tr,{name:"v-data-table-progress",absolute:!0,active:!0,color:typeof i.loading=="boolean"?void 0:i.loading,indeterminate:!0},{default:e.loader})])])]))}}),na=pt({groupBy:{type:Array,default:()=>[]}},"DataTable-group"),sa=Symbol.for("vuetify:data-table-group");function oa(i){return{groupBy:ke(i,"groupBy")}}function aa(i){const{groupBy:t,sortBy:e}=i,n=J(new Set),s=z(()=>t.value.map(c=>({...c,order:c.order??!1})).concat(e.value));function o(c){return n.value.has(c.id)}function a(c){const d=new Set(n.value);o(c)?d.delete(c.id):d.add(c.id),n.value=d}function r(c){function d(u){const h=[];for(const f of u.items)"type"in f&&f.type==="group"?h.push(...d(f)):h.push(f);return h}return d({type:"group",items:c,id:"dummy",key:"dummy",value:"dummy",depth:0})}const l={sortByWithGroups:s,toggleGroup:a,opened:n,groupBy:t,extractRows:r,isGroupOpen:o};return Ce(sa,l),l}function ra(){const i=De(sa);if(!i)throw new Error("Missing group!");return i}function Ml(i,t){if(!i.length)return[];const e=new Map;for(const n of i){const s=Do(n.raw,t);e.has(s)||e.set(s,[]),e.get(s).push(n)}return e}function la(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"root";if(!t.length)return[];const s=Ml(i,t[0]),o=[],a=t.slice(1);return s.forEach((r,l)=>{const c=t[0],d=`${n}_${c}_${l}`;o.push({depth:e,id:d,key:c,value:l,items:a.length?la(r,a,e+1,d):r,type:"group"})}),o}function ca(i,t){const e=[];for(const n of i)"type"in n&&n.type==="group"?(n.value!=null&&e.push(n),(t.has(n.id)||n.value==null)&&e.push(...ca(n.items,t))):e.push(n);return e}function da(i,t,e){return{flatItems:z(()=>{if(!t.value.length)return i.value;const s=la(i.value,t.value.map(o=>o.key));return ca(s,e.value)})}}const Pl=pt({item:{type:Object,required:!0}},"VDataTableGroupHeaderRow"),Cl=ne()({name:"VDataTableGroupHeaderRow",props:Pl(),setup(i,t){let{slots:e}=t;const{isGroupOpen:n,toggleGroup:s,extractRows:o}=ra(),{isSelected:a,isSomeSelected:r,select:l}=Ji(),{columns:c}=Ki(),d=z(()=>o([i.item]));return()=>b("tr",{class:"v-data-table-group-header-row",style:{"--v-data-table-group-header-row-depth":i.item.depth}},[c.value.map(u=>{var h,f;if(u.key==="data-table-group"){const g=n(i.item)?"$expand":"$next",m=()=>s(i.item);return((h=e["data-table-group"])==null?void 0:h.call(e,{item:i.item,count:d.value.length,props:{icon:g,onClick:m}}))??b(Li,{class:"v-data-table-group-header-row__column"},{default:()=>[b(Ai,{size:"small",variant:"text",icon:g,onClick:m},null),b("span",null,[i.item.value]),b("span",null,[Q("("),d.value.length,Q(")")])]})}if(u.key==="data-table-select"){const g=a(d.value),m=r(d.value)&&!g,p=_=>l(d.value,_);return((f=e["data-table-select"])==null?void 0:f.call(e,{props:{modelValue:g,indeterminate:m,"onUpdate:modelValue":p}}))??b("td",null,[b(En,{modelValue:g,indeterminate:m,"onUpdate:modelValue":p},null)])}return b("td",null,null)})])}}),Dl=pt({expandOnClick:Boolean,showExpand:Boolean,expanded:{type:Array,default:()=>[]}},"DataTable-expand"),ua=Symbol.for("vuetify:datatable:expanded");function ha(i){const t=rt(i,"expandOnClick"),e=ke(i,"expanded",i.expanded,r=>new Set(r),r=>[...r.values()]);function n(r,l){const c=new Set(e.value);l?c.add(r.value):c.delete(r.value),e.value=c}function s(r){return e.value.has(r.value)}function o(r){n(r,!s(r))}const a={expand:n,expanded:e,expandOnClick:t,isExpanded:s,toggleExpand:o};return Ce(ua,a),a}function fa(){const i=De(ua);if(!i)throw new Error("foo");return i}const Tl=pt({index:Number,item:Object,cellProps:[Object,Function],onClick:an(),onContextmenu:an(),onDblclick:an(),...Fn()},"VDataTableRow"),ga=ne()({name:"VDataTableRow",props:Tl(),setup(i,t){let{slots:e}=t;const{displayClasses:n,mobile:s}=Ln(i,"v-data-table__tr"),{isSelected:o,toggleSelect:a,someSelected:r,allSelected:l,selectAll:c}=Ji(),{isExpanded:d,toggleExpand:u}=fa(),{toggleSort:h,sortBy:f,isSorted:g}=ta(),{columns:m}=Ki();pe(()=>b("tr",{class:["v-data-table__tr",{"v-data-table__tr--clickable":!!(i.onClick||i.onContextmenu||i.onDblclick)},n.value],onClick:i.onClick,onContextmenu:i.onContextmenu,onDblclick:i.onDblclick},[i.item&&m.value.map((p,_)=>{const y=i.item,w=`item.${p.key}`,M=`header.${p.key}`,v={index:i.index,item:y.raw,internalItem:y,value:Do(y.columns,p.key),column:p,isSelected:o,toggleSelect:a,isExpanded:d,toggleExpand:u},C={column:p,selectAll:c,isSorted:g,toggleSort:h,sortBy:f.value,someSelected:r.value,allSelected:l.value,getSortIcon:()=>""},P=typeof i.cellProps=="function"?i.cellProps({index:v.index,item:v.item,internalItem:v.internalItem,value:v.value,column:p}):i.cellProps,S=typeof p.cellProps=="function"?p.cellProps({index:v.index,item:v.item,internalItem:v.internalItem,value:v.value}):p.cellProps;return b(Li,et({align:p.align,class:{"v-data-table__td--expanded-row":p.key==="data-table-expand","v-data-table__td--select-row":p.key==="data-table-select"},fixed:p.fixed,fixedOffset:p.fixedOffset,lastFixed:p.lastFixed,maxWidth:s.value?void 0:p.maxWidth,noPadding:p.key==="data-table-select"||p.key==="data-table-expand",nowrap:p.nowrap,width:s.value?void 0:p.width},P,S),{default:()=>{var A,D,I,j,K;if(e[w]&&!s.value)return(A=e[w])==null?void 0:A.call(e,v);if(p.key==="data-table-select")return((D=e["item.data-table-select"])==null?void 0:D.call(e,v))??b(En,{disabled:!y.selectable,modelValue:o([y]),onClick:ss(()=>a(y),["stop"])},null);if(p.key==="data-table-expand")return((I=e["item.data-table-expand"])==null?void 0:I.call(e,v))??b(Ai,{icon:d(y)?"$collapse":"$expand",size:"small",variant:"text",onClick:ss(()=>u(y),["stop"])},null);const k=W(v.value);return s.value?b(vt,null,[b("div",{class:"v-data-table__td-title"},[((j=e[M])==null?void 0:j.call(e,C))??p.title]),b("div",{class:"v-data-table__td-value"},[((K=e[w])==null?void 0:K.call(e,v))??k])]):k}})})]))}}),pa=pt({loading:[Boolean,String],loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideNoData:Boolean,items:{type:Array,default:()=>[]},noDataText:{type:String,default:"$vuetify.noDataText"},rowProps:[Object,Function],cellProps:[Object,Function],...Fn()},"VDataTableRows"),Bi=ne()({name:"VDataTableRows",inheritAttrs:!1,props:pa(),setup(i,t){let{attrs:e,slots:n}=t;const{columns:s}=Ki(),{expandOnClick:o,toggleExpand:a,isExpanded:r}=fa(),{isSelected:l,toggleSelect:c}=Ji(),{toggleGroup:d,isGroupOpen:u}=ra(),{t:h}=Xi(),{mobile:f}=Ln(i);return pe(()=>{var g,m;return i.loading&&(!i.items.length||n.loading)?b("tr",{class:"v-data-table-rows-loading",key:"loading"},[b("td",{colspan:s.value.length},[((g=n.loading)==null?void 0:g.call(n))??h(i.loadingText)])]):!i.loading&&!i.items.length&&!i.hideNoData?b("tr",{class:"v-data-table-rows-no-data",key:"no-data"},[b("td",{colspan:s.value.length},[((m=n["no-data"])==null?void 0:m.call(n))??h(i.noDataText)])]):b(vt,null,[i.items.map((p,_)=>{var M;if(p.type==="group"){const v={index:_,item:p,columns:s.value,isExpanded:r,toggleExpand:a,isSelected:l,toggleSelect:c,toggleGroup:d,isGroupOpen:u};return n["group-header"]?n["group-header"](v):b(Cl,et({key:`group-header_${p.id}`,item:p},rs(e,":group-header",()=>v)),n)}const y={index:_,item:p.raw,internalItem:p,columns:s.value,isExpanded:r,toggleExpand:a,isSelected:l,toggleSelect:c},w={...y,props:et({key:`item_${p.key??p.index}`,onClick:o.value?()=>{a(p)}:void 0,index:_,item:p,cellProps:i.cellProps,mobile:f.value},rs(e,":row",()=>y),typeof i.rowProps=="function"?i.rowProps({item:y.item,index:y.index,internalItem:y.internalItem}):i.rowProps)};return b(vt,{key:w.props.key},[n.item?n.item(w):b(ga,w.props,n),r(p)&&((M=n["expanded-row"])==null?void 0:M.call(n,y))])})])}),{}}});const ma=pt({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...Or(),...Ar(),...Ir(),...Rr()},"VTable"),he=ne()({name:"VTable",props:ma(),setup(i,t){let{slots:e,emit:n}=t;const{themeClasses:s}=Fr(i),{densityClasses:o}=Lr(i);return pe(()=>b(i.tag,{class:["v-table",{"v-table--fixed-height":!!i.height,"v-table--fixed-header":i.fixedHeader,"v-table--fixed-footer":i.fixedFooter,"v-table--has-top":!!e.top,"v-table--has-bottom":!!e.bottom,"v-table--hover":i.hover},s.value,o.value,i.class],style:i.style},{default:()=>{var a,r,l;return[(a=e.top)==null?void 0:a.call(e),e.default?b("div",{class:"v-table__wrapper",style:{height:Mt(i.height)}},[b("table",null,[e.default()])]):(r=e.wrapper)==null?void 0:r.call(e),(l=e.bottom)==null?void 0:l.call(e)]}})),{}}}),Ol=pt({items:{type:Array,default:()=>[]},itemValue:{type:[String,Array,Function],default:"id"},itemSelectable:{type:[String,Array,Function],default:null},rowProps:[Object,Function],cellProps:[Object,Function],returnObject:Boolean},"DataTable-items");function Al(i,t,e,n){const s=i.returnObject?t:ci(t,i.itemValue),o=ci(t,i.itemSelectable,!0),a=n.reduce((r,l)=>(l.key!=null&&(r[l.key]=ci(t,l.value)),r),{});return{type:"item",key:i.returnObject?ci(t,i.itemValue):s,index:e,value:s,selectable:o,columns:a,raw:t}}function Il(i,t,e){return t.map((n,s)=>Al(i,n,s,e))}function ba(i,t){return{items:z(()=>Il(i,i.items,t.value))}}function _a(i){let{page:t,itemsPerPage:e,sortBy:n,groupBy:s,search:o}=i;const a=Po("VDataTable"),r=z(()=>({page:t.value,itemsPerPage:e.value,sortBy:n.value,groupBy:s.value,search:o.value}));let l=null;oi(r,()=>{Co(l,r.value)||(l&&l.search!==r.value.search&&(t.value=1),a.emit("update:options",r.value),l=r.value)},{deep:!0,immediate:!0})}const ya=pt({...pa(),hideDefaultBody:Boolean,hideDefaultFooter:Boolean,hideDefaultHeader:Boolean,width:[String,Number],search:String,...Dl(),...na(),...pl(),...Ol(),...wl(),...kl(),...ia(),...ma()},"DataTable"),Rl=pt({...dl(),...ya(),...Bo(),...Wo()},"VDataTable"),Fl=ne()({name:"VDataTable",props:Rl(),emits:{"update:modelValue":i=>!0,"update:page":i=>!0,"update:itemsPerPage":i=>!0,"update:sortBy":i=>!0,"update:options":i=>!0,"update:groupBy":i=>!0,"update:expanded":i=>!0,"update:currentItems":i=>!0},setup(i,t){let{attrs:e,slots:n}=t;const{groupBy:s}=oa(i),{sortBy:o,multiSort:a,mustSort:r}=Qo(i),{page:l,itemsPerPage:c}=ul(i),{columns:d,headers:u,sortFunctions:h,sortRawFunctions:f,filterFunctions:g}=Uo(i,{groupBy:s,showSelect:rt(i,"showSelect"),showExpand:rt(i,"showExpand")}),{items:m}=ba(i,d),p=rt(i,"search"),{filteredItems:_}=zo(i,m,p,{transform:tt=>tt.columns,customKeyFilter:g}),{toggleSort:y}=Zo({sortBy:o,multiSort:a,mustSort:r,page:l}),{sortByWithGroups:w,opened:M,extractRows:v,isGroupOpen:C,toggleGroup:P}=aa({groupBy:s,sortBy:o}),{sortedItems:S}=ea(i,_,w,{transform:tt=>tt.columns,sortFunctions:h,sortRawFunctions:f}),{flatItems:k}=da(S,s,M),A=z(()=>k.value.length),{startIndex:D,stopIndex:I,pageCount:j,setItemsPerPage:K}=hl({page:l,itemsPerPage:c,itemsLength:A}),{paginatedItems:L}=gl({items:k,startIndex:D,stopIndex:I,itemsPerPage:c}),B=z(()=>v(L.value)),{isSelected:$,select:mt,selectAll:it,toggleSelect:It,someSelected:Ut,allSelected:Rt}=Ko(i,{allItems:m,currentPage:B}),{isExpanded:zt,toggleExpand:Dt}=ha(i);_a({page:l,itemsPerPage:c,sortBy:o,groupBy:s,search:p}),To({VDataTableRows:{hideNoData:rt(i,"hideNoData"),noDataText:rt(i,"noDataText"),loading:rt(i,"loading"),loadingText:rt(i,"loadingText")}});const ot=z(()=>({page:l.value,itemsPerPage:c.value,sortBy:o.value,pageCount:j.value,toggleSort:y,setItemsPerPage:K,someSelected:Ut.value,allSelected:Rt.value,isSelected:$,select:mt,selectAll:it,toggleSelect:It,isExpanded:zt,toggleExpand:Dt,isGroupOpen:C,toggleGroup:P,items:B.value.map(tt=>tt.raw),internalItems:B.value,groupedItems:L.value,columns:d.value,headers:u.value}));return pe(()=>{const tt=ls.filterProps(i),Tt=Ei.filterProps(i),en=Bi.filterProps(i),nn=he.filterProps(i);return b(he,et({class:["v-data-table",{"v-data-table--show-select":i.showSelect,"v-data-table--loading":i.loading},i.class],style:i.style},nn),{top:()=>{var bt;return(bt=n.top)==null?void 0:bt.call(n,ot.value)},default:()=>{var bt,Oe,Ae,Vt,be,Ie;return n.default?n.default(ot.value):b(vt,null,[(bt=n.colgroup)==null?void 0:bt.call(n,ot.value),!i.hideDefaultHeader&&b("thead",{key:"thead"},[b(Ei,Tt,n)]),(Oe=n.thead)==null?void 0:Oe.call(n,ot.value),!i.hideDefaultBody&&b("tbody",null,[(Ae=n["body.prepend"])==null?void 0:Ae.call(n,ot.value),n.body?n.body(ot.value):b(Bi,et(e,en,{items:L.value}),n),(Vt=n["body.append"])==null?void 0:Vt.call(n,ot.value)]),(be=n.tbody)==null?void 0:be.call(n,ot.value),(Ie=n.tfoot)==null?void 0:Ie.call(n,ot.value)])},bottom:()=>n.bottom?n.bottom(ot.value):!i.hideDefaultFooter&&b(vt,null,[b(Oo,null,null),b(ls,tt,{prepend:n["footer.prepend"]})])})}),{}}}),Ll=pt({...ya(),...na(),...qr(),...Bo()},"VDataTableVirtual"),xa=ne()({name:"VDataTableVirtual",props:Ll(),emits:{"update:modelValue":i=>!0,"update:sortBy":i=>!0,"update:options":i=>!0,"update:groupBy":i=>!0,"update:expanded":i=>!0},setup(i,t){let{attrs:e,slots:n}=t;const{groupBy:s}=oa(i),{sortBy:o,multiSort:a,mustSort:r}=Qo(i),{columns:l,headers:c,filterFunctions:d,sortFunctions:u,sortRawFunctions:h}=Uo(i,{groupBy:s,showSelect:rt(i,"showSelect"),showExpand:rt(i,"showExpand")}),{items:f}=ba(i,l),g=rt(i,"search"),{filteredItems:m}=zo(i,f,g,{transform:Tt=>Tt.columns,customKeyFilter:d}),{toggleSort:p}=Zo({sortBy:o,multiSort:a,mustSort:r}),{sortByWithGroups:_,opened:y,extractRows:w,isGroupOpen:M,toggleGroup:v}=aa({groupBy:s,sortBy:o}),{sortedItems:C}=ea(i,m,_,{transform:Tt=>Tt.columns,sortFunctions:u,sortRawFunctions:h}),{flatItems:P}=da(C,s,y),S=z(()=>w(P.value)),{isSelected:k,select:A,selectAll:D,toggleSelect:I,someSelected:j,allSelected:K}=Ko(i,{allItems:S,currentPage:S}),{isExpanded:L,toggleExpand:B}=ha(i),{containerRef:$,markerRef:mt,paddingTop:it,paddingBottom:It,computedItems:Ut,handleItemResize:Rt,handleScroll:zt,handleScrollend:Dt}=Kr(i,P),ot=z(()=>Ut.value.map(Tt=>Tt.raw));_a({sortBy:o,page:Ii(1),itemsPerPage:Ii(-1),groupBy:s,search:g}),To({VDataTableRows:{hideNoData:rt(i,"hideNoData"),noDataText:rt(i,"noDataText"),loading:rt(i,"loading"),loadingText:rt(i,"loadingText")}});const tt=z(()=>({sortBy:o.value,toggleSort:p,someSelected:j.value,allSelected:K.value,isSelected:k,select:A,selectAll:D,toggleSelect:I,isExpanded:L,toggleExpand:B,isGroupOpen:M,toggleGroup:v,items:S.value.map(Tt=>Tt.raw),internalItems:S.value,groupedItems:P.value,columns:l.value,headers:c.value}));pe(()=>{const Tt=Ei.filterProps(i),en=Bi.filterProps(i),nn=he.filterProps(i);return b(he,et({class:["v-data-table",{"v-data-table--loading":i.loading},i.class],style:i.style},nn),{top:()=>{var bt;return(bt=n.top)==null?void 0:bt.call(n,tt.value)},wrapper:()=>{var bt,Oe,Ae;return b("div",{ref:$,onScrollPassive:zt,onScrollend:Dt,class:"v-table__wrapper",style:{height:Mt(i.height)}},[b("table",null,[(bt=n.colgroup)==null?void 0:bt.call(n,tt.value),!i.hideDefaultHeader&&b("thead",{key:"thead"},[b(Ei,et(Tt,{sticky:i.fixedHeader}),n)]),!i.hideDefaultBody&&b("tbody",null,[b("tr",{ref:mt,style:{height:Mt(it.value),border:0}},[b("td",{colspan:l.value.length,style:{height:0,border:0}},null)]),(Oe=n["body.prepend"])==null?void 0:Oe.call(n,tt.value),b(Bi,et(e,en,{items:ot.value}),{...n,item:Vt=>b(Jr,{key:Vt.internalItem.index,renderless:!0,"onUpdate:height":be=>Rt(Vt.internalItem.index,be)},{default:be=>{var is;let{itemRef:Ie}=be;return((is=n.item)==null?void 0:is.call(n,{...Vt,itemRef:Ie}))??b(ga,et(Vt.props,{ref:Ie,key:Vt.internalItem.index,index:Vt.internalItem.index}),n)}})}),(Ae=n["body.append"])==null?void 0:Ae.call(n,tt.value),b("tr",{style:{height:Mt(It.value),border:0}},[b("td",{colspan:l.value.length,style:{height:0,border:0}},null)])])])])},bottom:()=>{var bt;return(bt=n.bottom)==null?void 0:bt.call(n,tt.value)}})})}}),El={components:{PatternCard:qi},props:{activusers:{type:Object,default:{}}},setup(i){const t=[{name:"Frozen Yogurt",calories:159,fat:6,carbs:24,protein:4,iron:1},{name:"Ice cream sandwich",calories:237,fat:9,carbs:37,protein:4.3,iron:1}],e=z({get(){let l=[];return i.activusers.forEach(c=>{let d=l.findIndex(u=>u.user.id==c.user.id);if(d==-1)l.push({user:c.user,info:{count:c.count,session:new Set([c.visitdate]),pages:1},tooltip:[{namepages:c.pages,count:c.count,unic:1}]});else{let u=l[d];u.info.count+=c.count,u.info.session.add(c.visitdate),u.info.pages+=1;let h=u.tooltip.findIndex(f=>f.namepages===c.pages);h==-1?u.tooltip.push({namepages:c.pages,count:c.count,unic:1}):(u.tooltip[h].count+=c.count,u.tooltip[h].unic+=1)}}),l}}),n=J([]);return{checkremote:Er,spravURL:Br,expanded:n,dessertHeaders:[{title:"",align:"",sortable:!1,key:"user"},{title:"просмотры",align:"start",key:"info.count",tooltip:"Количество посещенных страниц за период"},{title:"сессии",align:"start",key:"info.session.size",tooltip:"Сколько дней посещали Портал за период"},{title:"страницы",align:"start",key:"info.pages",tooltip:"Сколько суммарно посещено уникальных страниц за период"}],dataActivusers:e,subtable:[{title:"",align:"start",sortable:!1,key:"namepages",width:"60%",maxWidth:"60%",minWidth:"60%"},{title:"всего",align:"center",key:"count",width:"20%",maxWidth:"20%"},{title:"уникальных",align:"center",key:"unic",width:"20%",maxWidth:"20%"}],getColor:l=>l>100?"green":l>50?"orange":"red",getColor2:l=>l>10?"green":l>5?"orange":"red",desserts:t}}},Bl=["colspan"];function zl(i,t,e,n,s,o){const a=G("list-user"),r=G("pattern-card");return R(),H(r,{title:"Самые активные пользователи",ico:"mdi-star-circle"},{filling:x(()=>[b(xa,{expanded:n.expanded,"onUpdate:expanded":t[0]||(t[0]=l=>n.expanded=l),headers:n.dessertHeaders,items:n.dataActivusers,"item-value":"user","show-expand":"",class:"h-0 cursor-default bg-grey_white","sort-by":[{key:"info.count",order:"desc"}],density:"comfortable"},{"item.user":x(({value:l})=>[b(a,{author:l,from_which:"top-user"},null,8,["author"])]),headers:x(({columns:l,isSorted:c,getSortIcon:d,toggleSort:u})=>[T("tr",null,[(R(!0),ft(vt,null,ee(l,h=>(R(),ft("td",{key:h.key,class:"pa-0 py-2 pb-3"},[h.title!=""?(R(),H(Yt,{key:0,location:"top"},{activator:x(({props:f})=>[b(Ai,et({ref_for:!0},f,{"append-icon":c(h)?d(h):"",variant:"text",class:"text-caption",onClick:()=>u(h)}),{append:x(()=>[b(wt,{size:"x-small"})]),default:x(()=>[Q(W(h.title)+" ",1)]),_:2},1040,["append-icon","onClick"])]),default:x(()=>[T("span",null,W(h.tooltip),1)]),_:2},1024)):Qe("",!0)]))),128))])]),"expanded-row":x(({columns:l,item:c})=>[T("tr",null,[T("td",{colspan:l.length},[b(ge,{class:"my-2 elevation-0",color:"grey"},{default:x(()=>[b(Oo),b(Fl,{headers:n.subtable,items:c.tooltip,"items-per-page":"-1",class:"subtable cursor-default px-3 bg-grey-lighten-5 text-body-2",density:"compact","sort-by":[{key:"count",order:"desc"}]},{headers:x(({columns:d,isSorted:u,getSortIcon:h,toggleSort:f})=>[T("tr",null,[(R(!0),ft(vt,null,ee(d,g=>(R(),ft("td",{key:g.key,class:"pa-0"},[b(Ai,{"append-icon":u(g)?h(g):"",variant:"text",class:"text-caption",onClick:()=>f(g)},{append:x(()=>[b(wt,{size:"x-small"})]),default:x(()=>[Q(W(g.title)+" ",1)]),_:2},1032,["append-icon","onClick"])]))),128))])]),"item.count":x(({value:d})=>[T("span",{class:qt(["text-"+n.getColor2(d),"font-weight-medium text-subtitle-2"])},W(d),3)]),"item.unic":x(({value:d})=>[T("span",{class:qt(["text-"+n.getColor(d),"font-weight-medium text-subtitle-2"])},W(d),3)]),_:2},1032,["headers","items"])]),_:2},1024)],8,Bl)])]),_:1},8,["expanded","headers","items"])]),_:1})}const va=ut(El,[["render",zl]]),Vl={props:{title:{type:String,default:""}}},Hl={class:"font-weight-medium text-button text-teal-darken-4 cursor-default"};function Wl(i,t,e,n,s,o){return R(),H(ge,{class:"h-100 d-flex",variant:"flat"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{class:"flex-grow-0 bg-teal-lighten-5 pa-0 w100"},{default:x(()=>[T("span",Hl,W(e.title),1)]),_:1}),b(F,{class:"d-flex flex-column pa-0"},{default:x(()=>[So(i.$slots,"filling_feedback")]),_:3})]),_:3})]),_:3})}const zn=ut(Vl,[["render",Wl]]),Nl={components:{PatternCardFeed:zn},props:{data:{type:Object,default:()=>{}}}},jl=T("thead",null,[T("tr",null,[T("th",{class:"text-center text-subtitle-1 font-weight-regular"}," всего "),T("th",{class:"text-center text-subtitle-1 font-weight-regular"}," за период ")])],-1),$l={class:"text-center text-h6 font-weight-bold"},Yl={class:"text-center text-h6 font-weight-bold"};function Ul(i,t,e,n,s,o){const a=G("pattern-card-feed");return R(),H(a,{title:e.data.title},{filling_feedback:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,null,{default:x(()=>[b(he,{density:"compact",class:"px-7"},{default:x(()=>[jl,T("tbody",null,[T("tr",null,[T("th",$l,W(e.data.all),1),T("th",Yl,W(e.data.period),1)])])]),_:1})]),_:1})]),_:1})]),_:1},8,["title"])}const Xl=ut(Nl,[["render",Ul]]),Gl={props:{comment:{type:Object,default:()=>{}}},setup(){return{formaComaTime:Ao}}};function ql(i,t,e,n,s,o){return R(),H(ge,{"max-width":"400",density:"compact",class:"bg-transparent"},{default:x(()=>[b(_n,{class:"pb-0"},{default:x(()=>[Q("Оставлено комментариев")]),_:1}),b(zr,null,{default:x(()=>[Q("Последний комментарий оставлен "+W(n.formaComaTime(e.comment.time_create)),1)]),_:1}),b(_n,{class:"text-caption"},{default:x(()=>[Q(W(e.comment.comment),1)]),_:1})]),_:1})}const Kl=ut(Gl,[["render",ql]]),Jl={components:{PatternCardFeed:zn,TooltipText:Io,CardComment:Kl},props:{top:{type:Object,default:()=>{}}}},Ql={class:"text-center text-caption font-weight-medium"},Zl={class:"text-center text-caption font-weight-medium"},tc={class:"text-center text-h6 font-weight-bold"},ec={class:"text-center text-h6 font-weight-bold"};function ic(i,t,e,n,s,o){const a=G("list-user"),r=G("card-comment"),l=G("pattern-card-feed");return R(),H(l,{title:"Самый активный критик"},{filling_feedback:x(()=>[e.top.comment[0].time_create!="1990-01-01"?(R(),H(U,{key:0,"no-gutters":""},{default:x(()=>[b(F,{lg:"5",class:"bg-teal-lighten-4 align-self-center"},{default:x(()=>[b(a,{author:e.top.author,from_which:"top_comment"},null,8,["author"])]),_:1}),b(F,{class:"align-self-center pl-0"},{default:x(()=>[b(he,{density:"compact",class:"pa-0"},{default:x(()=>[T("thead",null,[T("tr",null,[T("th",Ql,[b(Yt,{location:"top"},{activator:x(({props:c})=>[T("span",Ri(Fi(c)),[b(wt,{class:"cursor-help",icon:"mdi-comment-text-outline",color:"cyan-darken-4",size:"x-large"})],16)]),default:x(()=>[b(r,{comment:e.top.comment[0]},null,8,["comment"])]),_:1})]),T("th",Zl,[b(Yt,{location:"top"},{activator:x(({props:c})=>[T("span",Ri(Fi(c)),[b(wt,{class:"cursor-help",icon:"mdi-star",color:"orange",size:"x-large"})],16)]),default:x(()=>[Q(" Поставлено оценок ")]),_:1})])])]),T("tbody",null,[T("tr",null,[T("th",tc,W(e.top.comment.length),1),T("th",ec,W(e.top.score),1)])])]),_:1})]),_:1})]),_:1})):(R(),H(U,{key:1,class:"align-center flex-column gap mt-n2","no-gutters":""},{default:x(()=>[b(F,{class:"text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" За выбранный период комментариев нет ")]),_:1})]),_:1}))]),_:1})}const nc=ut(Jl,[["render",ic]]),sc={props:{rating:{type:Object,default:()=>{}}},components:{PatternCardFeed:zn},setup(i){return{avgcriteria:z({get(){let e=0;return i.rating.forEach(n=>{e+=n.ratings}),parseFloat(e/i.rating.length).toFixed(2)}})}}},oc={key:0,class:"pt-1"},ac={key:1,class:"d-flex flex-column"};function rc(i,t,e,n,s,o){const a=G("pattern-card-feed");return R(),H(a,{title:"Средняя оценка"},{filling_feedback:x(()=>[e.rating.length!=0?(R(),ft("div",oc,[b(U,{"no-gutters":""},{default:x(()=>[b(F,{class:"text-h4 font-weight-medium"},{default:x(()=>[Q(W(n.avgcriteria),1)]),_:1})]),_:1}),b(U,{class:"align-center flex-column scoreheight","no-gutters":""},{default:x(()=>[(R(!0),ft(vt,null,ee(e.rating,(r,l)=>(R(),ft("div",{class:"flex-column d-flex pa-0",key:l},[b(F,{lg:"1",class:"text-subtitle-1 font-weight-regular cursor-default w100 pa-0"},{default:x(()=>[b(Yt,{text:r.name,location:"left"},{activator:x(({props:c})=>[b(wt,et({class:"pb-4 pr-3",ref_for:!0},c,{size:"small",color:r.color,icon:r.ico}),null,16,["color","icon"])]),_:2},1032,["text"]),b(Qr,{modelValue:r.ratings,"onUpdate:modelValue":c=>r.ratings=c,hover:typeof l=="number","half-increments":"",readonly:"",size:25,color:"yellow",density:"comfortable"},null,8,["modelValue","onUpdate:modelValue","hover"])]),_:2},1024)]))),128))]),_:1})])):(R(),ft("div",ac,[b(U,{class:"align-center flex-column scoreheight gap mt-n2","no-gutters":""},{default:x(()=>[b(F,{class:"text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[Q(" За выбранный период оценок нет ")]),_:1})]),_:1})]))]),_:1})}const lc=ut(sc,[["render",rc]]),cc={components:{CardTotal:Vo,TopUser:va,PatternCard:qi,CardFeedback:Xl,CardTopComment:nc,FeedstarLike:Zr,StatistikLike:lc},props:{feedback:{type:Object,default:()=>({feed:[],last_comment:{time_create:"1990-01-01"}})}},setup(i){const t=z({get(){let e={},n={comment:[{time_create:"1990-01-01",comment:""}],score:0};if(i.feedback.feed.forEach(s=>{e[s.author.id]||(e[s.author.id]=0),e[s.author.id]+=1}),Object.keys(e).length>0){let s=Object.keys(e).reduce((a,r)=>e[a]>e[r]?a:r),o=i.feedback.feed.filter(a=>a.author.id==s);n=Object.assign({},o[o.length-1]),n.fio=Kt(n.author),n.score=o.length,n.comment=o.filter(a=>a.comment.length>0).sort((a,r)=>r.id-a.id)}return n}});return{formaComaTime:Ao,dataTopUser:t}}},dc=T("br",null,null,-1),uc={class:"text-subtitle-1 font-weight-bold"};function hc(i,t,e,n,s,o){const a=G("statistik-like"),r=G("card-feedback"),l=G("card-top-comment"),c=G("pattern-card");return R(),H(c,{title:"Обратная связь",ico:"mdi-comment-multiple-outline"},{filling:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{lg:"1",class:"w100"},{default:x(()=>[b(ge,{variant:"flat",class:"text-subtitle-1 font-weight-regular cursor-default"},{default:x(()=>[Q(" Последний комментарий оставлен: "),dc,Q(),T("span",uc,W(n.formaComaTime(e.feedback.last_comment.time_create)),1)]),_:1})]),_:1}),b(F,{lg:"2",class:"w100"},{default:x(()=>[b(a,{rating:e.feedback.criteria},null,8,["rating"])]),_:1}),(R(!0),ft(vt,null,ee(e.feedback.data,d=>(R(),H(F,{class:"w100 flex-grow-0",key:d},{default:x(()=>[b(r,{data:d},null,8,["data"])]),_:2},1024))),128)),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(l,{top:n.dataTopUser},null,8,["top"])]),_:1})]),_:1})]),_:1})}const fc=ut(cc,[["render",hc]]);const gc={props:{datedefault:{type:Date,default:""}},setup(i,{emit:t}){const e=Vr();Ot(new Date);const n=J(!1),s=J(null);return{menudate:n,selectedDate:s,dateStart:()=>{t("returndate",s.value),n.value=!1},formatComa:Ro,formatDash:Ot,appStore:e}}};function pc(i,t,e,n,s,o){return R(),H(Hr,{modelValue:n.menudate,"onUpdate:modelValue":t[2]||(t[2]=a=>n.menudate=a),"close-on-content-click":!1,"nudge-right":40,transition:"scale-transition","offset-y":""},{activator:x(({props:a})=>[b(tl,et({modelValue:n.selectedDate,"onUpdate:modelValue":t[0]||(t[0]=r=>n.selectedDate=r),value:n.formatComa(e.datedefault),"no-resize":"",class:"my-textarea",rows:"1","hide-details":"",style:{width:"119px"},variant:"plain",density:"compact"},a),{"prepend-inner":x(()=>[b(wt,et(a,{icon:"mdi-calendar-today",color:"cyan-darken-3",size:"x-small"}),null,16)]),_:2},1040,["modelValue","value"])]),default:x(()=>[b(el,{locale:"ru"},{default:x(()=>[b(Gr,{modelValue:n.selectedDate,"onUpdate:modelValue":[t[1]||(t[1]=a=>n.selectedDate=a),n.dateStart],"show-adjacent-months":"","hide-header":"",border:"",max:n.formatDash(new Date),min:n.formatDash(n.appStore.countvisitor.visitdate)},null,8,["modelValue","onUpdate:modelValue","max","min"])]),_:1})]),_:1},8,["modelValue"])}const wa=ut(gc,[["render",pc]]);/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function ai(i){return i+.5|0}const Jt=(i,t,e)=>Math.max(Math.min(i,e),t);function Ve(i){return Jt(ai(i*2.55),0,255)}function te(i){return Jt(ai(i*255),0,255)}function jt(i){return Jt(ai(i/2.55)/100,0,1)}function cs(i){return Jt(ai(i*100),0,100)}const St={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},wn=[..."0123456789ABCDEF"],mc=i=>wn[i&15],bc=i=>wn[(i&240)>>4]+wn[i&15],di=i=>(i&240)>>4===(i&15),_c=i=>di(i.r)&&di(i.g)&&di(i.b)&&di(i.a);function yc(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&St[i[1]]*17,g:255&St[i[2]]*17,b:255&St[i[3]]*17,a:t===5?St[i[4]]*17:255}:(t===7||t===9)&&(e={r:St[i[1]]<<4|St[i[2]],g:St[i[3]]<<4|St[i[4]],b:St[i[5]]<<4|St[i[6]],a:t===9?St[i[7]]<<4|St[i[8]]:255})),e}const xc=(i,t)=>i<255?t(i):"";function vc(i){var t=_c(i)?mc:bc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xc(i.a,t):void 0}const wc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ka(i,t,e){const n=t*Math.min(e,1-e),s=(o,a=(o+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function kc(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Sc(i,t,e){const n=ka(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Mc(i,t,e,n,s){return i===s?(t-e)/n+(t.5?d/(2-o-a):d/(o+a),l=Mc(e,n,s,d,o),l=l*60+.5),[l|0,c||0,r]}function Hn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(te)}function Wn(i,t,e){return Hn(ka,i,t,e)}function Pc(i,t,e){return Hn(Sc,i,t,e)}function Cc(i,t,e){return Hn(kc,i,t,e)}function Sa(i){return(i%360+360)%360}function Dc(i){const t=wc.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Ve(+t[5]):te(+t[5]));const s=Sa(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Pc(s,o,a):t[1]==="hsv"?n=Cc(s,o,a):n=Wn(s,o,a),{r:n[0],g:n[1],b:n[2],a:e}}function Tc(i,t){var e=Vn(i);e[0]=Sa(e[0]+t),e=Wn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Oc(i){if(!i)return;const t=Vn(i),e=t[0],n=cs(t[1]),s=cs(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${jt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const ds={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},us={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ac(){const i={},t=Object.keys(us),e=Object.keys(ds);let n,s,o,a,r;for(n=0;n>16&255,o>>8&255,o&255]}return i}let ui;function Ic(i){ui||(ui=Ac(),ui.transparent=[0,0,0,0]);const t=ui[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Rc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Fc(i){const t=Rc.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?Ve(a):Jt(a*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ve(n):Jt(n,0,255)),s=255&(t[4]?Ve(s):Jt(s,0,255)),o=255&(t[6]?Ve(o):Jt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Lc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${jt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const rn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,_e=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ec(i,t,e){const n=_e(jt(i.r)),s=_e(jt(i.g)),o=_e(jt(i.b));return{r:te(rn(n+e*(_e(jt(t.r))-n))),g:te(rn(s+e*(_e(jt(t.g))-s))),b:te(rn(o+e*(_e(jt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function hi(i,t,e){if(i){let n=Vn(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Wn(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Ma(i,t){return i&&Object.assign(t||{},i)}function hs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=te(i[3]))):(t=Ma(i,{r:0,g:0,b:0,a:1}),t.a=te(t.a)),t}function zc(i){return i.charAt(0)==="r"?Fc(i):Dc(i)}class Ze{constructor(t){if(t instanceof Ze)return t;const e=typeof t;let n;e==="object"?n=hs(t):e==="string"&&(n=yc(t)||Ic(t)||zc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ma(this._rgb);return t&&(t.a=jt(t.a)),t}set rgb(t){this._rgb=hs(t)}rgbString(){return this._valid?Lc(this._rgb):void 0}hexString(){return this._valid?vc(this._rgb):void 0}hslString(){return this._valid?Oc(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Ec(this._rgb,t._rgb,e)),this}clone(){return new Ze(this.rgb)}alpha(t){return this._rgb.a=te(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ai(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return hi(this._rgb,2,t),this}darken(t){return hi(this._rgb,2,-t),this}saturate(t){return hi(this._rgb,1,t),this}desaturate(t){return hi(this._rgb,1,-t),this}rotate(t){return Tc(this._rgb,t),this}}/*! + */function ai(i){return i+.5|0}const Jt=(i,t,e)=>Math.max(Math.min(i,e),t);function Ve(i){return Jt(ai(i*2.55),0,255)}function te(i){return Jt(ai(i*255),0,255)}function jt(i){return Jt(ai(i/2.55)/100,0,1)}function cs(i){return Jt(ai(i*100),0,100)}const St={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},wn=[..."0123456789ABCDEF"],mc=i=>wn[i&15],bc=i=>wn[(i&240)>>4]+wn[i&15],di=i=>(i&240)>>4===(i&15),_c=i=>di(i.r)&&di(i.g)&&di(i.b)&&di(i.a);function yc(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&St[i[1]]*17,g:255&St[i[2]]*17,b:255&St[i[3]]*17,a:t===5?St[i[4]]*17:255}:(t===7||t===9)&&(e={r:St[i[1]]<<4|St[i[2]],g:St[i[3]]<<4|St[i[4]],b:St[i[5]]<<4|St[i[6]],a:t===9?St[i[7]]<<4|St[i[8]]:255})),e}const xc=(i,t)=>i<255?t(i):"";function vc(i){var t=_c(i)?mc:bc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xc(i.a,t):void 0}const wc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ka(i,t,e){const n=t*Math.min(e,1-e),s=(o,a=(o+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function kc(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Sc(i,t,e){const n=ka(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Mc(i,t,e,n,s){return i===s?(t-e)/n+(t.5?d/(2-o-a):d/(o+a),l=Mc(e,n,s,d,o),l=l*60+.5),[l|0,c||0,r]}function Hn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(te)}function Wn(i,t,e){return Hn(ka,i,t,e)}function Pc(i,t,e){return Hn(Sc,i,t,e)}function Cc(i,t,e){return Hn(kc,i,t,e)}function Sa(i){return(i%360+360)%360}function Dc(i){const t=wc.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Ve(+t[5]):te(+t[5]));const s=Sa(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Pc(s,o,a):t[1]==="hsv"?n=Cc(s,o,a):n=Wn(s,o,a),{r:n[0],g:n[1],b:n[2],a:e}}function Tc(i,t){var e=Vn(i);e[0]=Sa(e[0]+t),e=Wn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Oc(i){if(!i)return;const t=Vn(i),e=t[0],n=cs(t[1]),s=cs(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${jt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const ds={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},us={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ac(){const i={},t=Object.keys(us),e=Object.keys(ds);let n,s,o,a,r;for(n=0;n>16&255,o>>8&255,o&255]}return i}let ui;function Ic(i){ui||(ui=Ac(),ui.transparent=[0,0,0,0]);const t=ui[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Rc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Fc(i){const t=Rc.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?Ve(a):Jt(a*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ve(n):Jt(n,0,255)),s=255&(t[4]?Ve(s):Jt(s,0,255)),o=255&(t[6]?Ve(o):Jt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Lc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${jt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const rn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,_e=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ec(i,t,e){const n=_e(jt(i.r)),s=_e(jt(i.g)),o=_e(jt(i.b));return{r:te(rn(n+e*(_e(jt(t.r))-n))),g:te(rn(s+e*(_e(jt(t.g))-s))),b:te(rn(o+e*(_e(jt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function hi(i,t,e){if(i){let n=Vn(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Wn(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Ma(i,t){return i&&Object.assign(t||{},i)}function hs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=te(i[3]))):(t=Ma(i,{r:0,g:0,b:0,a:1}),t.a=te(t.a)),t}function Bc(i){return i.charAt(0)==="r"?Fc(i):Dc(i)}class Ze{constructor(t){if(t instanceof Ze)return t;const e=typeof t;let n;e==="object"?n=hs(t):e==="string"&&(n=yc(t)||Ic(t)||Bc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ma(this._rgb);return t&&(t.a=jt(t.a)),t}set rgb(t){this._rgb=hs(t)}rgbString(){return this._valid?Lc(this._rgb):void 0}hexString(){return this._valid?vc(this._rgb):void 0}hslString(){return this._valid?Oc(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Ec(this._rgb,t._rgb,e)),this}clone(){return new Ze(this.rgb)}alpha(t){return this._rgb.a=te(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ai(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return hi(this._rgb,2,t),this}darken(t){return hi(this._rgb,2,-t),this}saturate(t){return hi(this._rgb,1,t),this}desaturate(t){return hi(this._rgb,1,-t),this}rotate(t){return Tc(this._rgb,t),this}}/*! * Chart.js v4.4.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License - */function Ht(){}const Bc=(()=>{let i=0;return()=>i++})();function X(i){return i===null||typeof i>"u"}function st(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function V(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Ct(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Ft(i,t){return Ct(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const Vc=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function Y(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function N(i,t,e,n){let s,o,a;if(st(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;si,x:i=>i.x,y:i=>i.y};function Nc(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function jc(i){const t=Nc(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Hi(i,t){return(fs[t]||(fs[t]=jc(t)))(i)}function Nn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Wi=i=>typeof i<"u",ie=i=>typeof i=="function",gs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function $c(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const nt=Math.PI,dt=2*nt,Yc=dt+nt,Ni=Number.POSITIVE_INFINITY,Uc=nt/180,lt=nt/2,se=nt/4,ps=nt*2/3,kn=Math.log10,Se=Math.sign;function Ye(i,t,e){return Math.abs(i-t)s-o).pop(),t}function ti(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Gc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function qc(i,t,e){let n,s,o;for(n=0,s=i.length;nl&&c=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function $n(i,t,e){e=e||(a=>i[a]1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const de=(i,t,e,n)=>$n(i,e,n?s=>{const o=i[s][t];return oi[s][t]$n(i,e,n=>i[n][t]>=e);function td(i,t,e){let n=0,s=i.length;for(;nn&&i[s-1]>e;)s--;return n>0||s{const n="_onData"+Nn(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function _s(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Da.forEach(o=>{delete i[o]}),delete i._chartjs)}function id(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ta=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Oa(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Ta.call(window,()=>{n=!1,i.apply(t,e)}))}}function nd(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Yn=i=>i==="start"?"left":i==="end"?"right":"center",ht=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,sd=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function od(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:c,max:d,minDefined:u,maxDefined:h}=a.getUserBounds();u&&(s=gt(Math.min(de(r,l,c).lo,e?n:de(t,l,a.getPixelForValue(c)).lo),0,n-1)),h?o=gt(Math.max(de(r,a.axis,d,!0).hi+1,e?0:de(t,l,a.getPixelForValue(d),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function ad(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const fi=i=>i===0||i===1,ys=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*dt/e)),xs=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*dt/e)+1,Ue={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*lt)+1,easeOutSine:i=>Math.sin(i*lt),easeInOutSine:i=>-.5*(Math.cos(nt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>fi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>fi(i)?i:ys(i,.075,.3),easeOutElastic:i=>fi(i)?i:xs(i,.075,.3),easeInOutElastic(i){return fi(i)?i:i<.5?.5*ys(i*2,.1125,.45):.5+.5*xs(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ue.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ue.easeInBounce(i*2)*.5:Ue.easeOutBounce(i*2-1)*.5+.5};function Un(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vs(i){return Un(i)?i:new Ze(i)}function ln(i){return Un(i)?i:new Ze(i).saturate(.5).darken(.1).hexString()}const rd=["x","y","borderWidth","radius","tension"],ld=["color","borderColor","backgroundColor"];function cd(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:ld},numbers:{type:"number",properties:rd}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function dd(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ws=new Map;function ud(i,t){t=t||{};const e=i+JSON.stringify(t);let n=ws.get(e);return n||(n=new Intl.NumberFormat(i,t),ws.set(e,n)),n}function Aa(i,t,e){return ud(t,e).format(i)}const Ia={values(i){return st(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=hd(i,e)}const a=kn(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Aa(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(kn(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?Ia.numeric.call(this,i,t,e):""}};function hd(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ra={formatters:Ia};function fd(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ra.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const fe=Object.create(null),Mn=Object.create(null);function Xe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;nn.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>ln(s.backgroundColor),this.hoverBorderColor=(n,s)=>ln(s.borderColor),this.hoverColor=(n,s)=>ln(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return cn(this,t,e)}get(t){return Xe(this,t)}describe(t,e){return cn(Mn,t,e)}override(t,e){return cn(fe,t,e)}route(t,e,n,s){const o=Xe(this,t),a=Xe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return V(l)?Object.assign({},c,l):E(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new gd({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cd,dd,fd]);function pd(i){return!i||X(i.size)||X(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ks(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function oe(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Ss(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Pn(i,t,e,n){Fa(i,t,e,n,null)}function Fa(i,t,e,n,s){let o,a,r,l,c,d,u,h;const f=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*Uc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(p),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,m,0,0,dt):i.arc(e,n,m,0,dt),i.closePath();break;case"triangle":d=s?s/2:m,i.moveTo(e+Math.sin(p)*d,n-Math.cos(p)*m),p+=ps,i.lineTo(e+Math.sin(p)*d,n-Math.cos(p)*m),p+=ps,i.lineTo(e+Math.sin(p)*d,n-Math.cos(p)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(p+se)*l,u=Math.cos(p+se)*(s?s/2-c:l),r=Math.sin(p+se)*l,h=Math.sin(p+se)*(s?s/2-c:l),i.arc(e-u,n-r,c,p-nt,p-lt),i.arc(e+h,n-a,c,p-lt,p),i.arc(e+u,n+r,c,p,p+lt),i.arc(e-h,n+a,c,p+lt,p+nt),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,d=s?s/2:l,i.rect(e-d,n-l,2*d,2*l);break}p+=se;case"rectRot":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+h,n-a),i.lineTo(e+u,n+r),i.lineTo(e-h,n+a),i.closePath();break;case"crossRot":p+=se;case"cross":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a);break;case"star":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a),p+=se,u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a);break;case"line":a=s?s/2:Math.cos(p)*m,r=Math.sin(p)*m,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(p)*(s?s/2:m),n+Math.sin(p)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ei(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,_d(i,o),l=0;l+i||0;function qn(i,t){const e={},n=V(t),s=n?Object.keys(t):t,o=V(i)?n?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=Sd(o(a));return e}function La(i){return qn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function ve(i){return qn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(i){const t=La(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ct(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=E(i.style,t.style);n&&!(""+n).match(wd)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:E(i.family,t.family),lineHeight:kd(E(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:E(i.weight,t.weight),string:""};return s.string=pd(s),s}function q(i,t,e,n){let s=!0,o,a,r;for(o=0,a=i.length;oe&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function me(i,t){return Object.assign(Object.create(i),t)}function Kn(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Va("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Kn([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return za(r,l,()=>Rd(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ps(r).includes(l)},ownKeys(r){return Ps(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function Me(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ea(i,n),setContext:o=>Me(i,o,e,n),override:o=>Me(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return za(o,a,()=>Cd(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Ea(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:ie(e)?e:()=>e,isIndexable:ie(n)?n:()=>n}}const Pd=(i,t)=>i?i+Nn(t):t,Jn=(i,t)=>V(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function za(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Cd(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return ie(r)&&a.isScriptable(t)&&(r=Dd(t,r,i,e)),st(r)&&r.length&&(r=Td(t,r,i,a.isIndexable)),Jn(t,r)&&(r=Me(r,s,o&&o[t],a)),r}function Dd(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Jn(i,l)&&(l=Qn(s._scopes,s,i,l)),l}function Td(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(V(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const u=Qn(c,s,i,d);t.push(Me(u,o,a&&a[i],r))}}return t}function Ba(i,t,e){return ie(i)?i(t,e):i}const Od=(i,t)=>i===!0?t:typeof i=="string"?Hi(t,i):void 0;function Ad(i,t,e,n,s){for(const o of t){const a=Od(e,o);if(a){i.add(a);const r=Ba(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Qn(i,t,e,n){const s=t._rootScopes,o=Ba(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=Ms(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ms(r,a,o,l,n),l===null)?!1:Kn(Array.from(r),[""],s,o,()=>Id(t,e,n))}function Ms(i,t,e,n,s){for(;e;)e=Ad(i,t,e,n,s);return e}function Id(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return st(s)&&V(e)?e:s||{}}function Rd(i,t,e,n){let s;for(const o of t)if(s=Va(Pd(o,i),e),typeof s<"u")return Jn(i,s)?Qn(e,n,i,s):s}function Va(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ps(i){let t=i._keys;return t||(t=i._keys=Fd(i._scopes)),t}function Fd(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}const Ld=Number.EPSILON||1e-14,Pe=(i,t)=>ti==="x"?"y":"x";function Ed(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Sn(o,s),l=Sn(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const u=n*c,h=n*d;return{previous:{x:o.x-u*(a.x-s.x),y:o.y-u*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function zd(i,t,e){const n=i.length;let s,o,a,r,l,c=Pe(i,0);for(let d=0;d!c.skip)),t.cubicInterpolationMode==="monotone")Vd(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function Nd(i,t){return Qi(i).getPropertyValue(t)}const jd=["top","right","bottom","left"];function ue(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=jd[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const $d=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Yd(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if($d(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function re(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Qi(e),o=s.boxSizing==="border-box",a=ue(s,"padding"),r=ue(s,"border","width"),{x:l,y:c,box:d}=Yd(i,e),u=a.left+(d&&r.left),h=a.top+(d&&r.top);let{width:f,height:g}=t;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((c-h)/g*e.height/n)}}function Ud(i,t,e){let n,s;if(t===void 0||e===void 0){const o=ts(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Qi(o),l=ue(r,"border","width"),c=ue(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=$i(r.maxWidth,o,"clientWidth"),s=$i(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Ni,maxHeight:s||Ni}}const pi=i=>Math.round(i*10)/10;function Xd(i,t,e,n){const s=Qi(i),o=ue(s,"margin"),a=$i(s.maxWidth,i,"clientWidth")||Ni,r=$i(s.maxHeight,i,"clientHeight")||Ni,l=Ud(i,t,e);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const h=ue(s,"border","width"),f=ue(s,"padding");c-=f.width+h.width,d-=f.height+h.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?c/n:d-o.height),c=pi(Math.min(c,a,l.maxWidth)),d=pi(Math.min(d,r,l.maxHeight)),c&&!d&&(d=pi(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&d>l.height&&(d=l.height,c=pi(Math.floor(d*n))),{width:c,height:d}}function Cs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Gd=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Zn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ds(i,t){const e=Nd(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function le(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function qd(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Kd(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=le(i,s,e),r=le(s,o,e),l=le(o,t,e),c=le(a,r,e),d=le(r,l,e);return le(c,d,e)}const Jd=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Qd=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function we(i,t,e){return i?Jd(t,e):Qd()}function Wa(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Na(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ja(i){return i==="angle"?{between:jn,compare:Jc,normalize:Gt}:{between:Qt,compare:(t,e)=>t-e,normalize:t=>t}}function Ts({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Zd(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=ja(n),l=t.length;let{start:c,end:d,loop:u}=i,h,f;if(u){for(c+=l,d+=l,h=0,f=l;hl(s,w,_)&&r(s,w)!==0,v=()=>r(o,_)===0||l(o,w,_),C=()=>m||M(),P=()=>!m||v();for(let S=d,k=d;S<=u;++S)y=t[S%a],!y.skip&&(_=c(y[n]),_!==w&&(m=l(_,s,o),p===null&&C()&&(p=r(_,s)===0?S:k),p!==null&&P()&&(g.push(Ts({start:p,end:S,loop:h,count:a,style:f})),p=null),k=S,w=_));return p!==null&&g.push(Ts({start:p,end:u,loop:h,count:a,style:f})),g}function eu(i,t){const e=[],n=i.segments;for(let s=0;ss&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function nu(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function su(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=iu(e,s,o,n);if(n===!0)return Os(i,[{start:a,end:r,loop:o}],e,t);const l=r{let i=0;return()=>i++})();function X(i){return i===null||typeof i>"u"}function st(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function V(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Ct(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Ft(i,t){return Ct(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const Vc=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function Y(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function N(i,t,e,n){let s,o,a;if(st(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;si,x:i=>i.x,y:i=>i.y};function Nc(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function jc(i){const t=Nc(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Hi(i,t){return(fs[t]||(fs[t]=jc(t)))(i)}function Nn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Wi=i=>typeof i<"u",ie=i=>typeof i=="function",gs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function $c(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const nt=Math.PI,dt=2*nt,Yc=dt+nt,Ni=Number.POSITIVE_INFINITY,Uc=nt/180,lt=nt/2,se=nt/4,ps=nt*2/3,kn=Math.log10,Se=Math.sign;function Ye(i,t,e){return Math.abs(i-t)s-o).pop(),t}function ti(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Gc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function qc(i,t,e){let n,s,o;for(n=0,s=i.length;nl&&c=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function $n(i,t,e){e=e||(a=>i[a]1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const de=(i,t,e,n)=>$n(i,e,n?s=>{const o=i[s][t];return oi[s][t]$n(i,e,n=>i[n][t]>=e);function td(i,t,e){let n=0,s=i.length;for(;nn&&i[s-1]>e;)s--;return n>0||s{const n="_onData"+Nn(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function _s(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Da.forEach(o=>{delete i[o]}),delete i._chartjs)}function id(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ta=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Oa(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Ta.call(window,()=>{n=!1,i.apply(t,e)}))}}function nd(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Yn=i=>i==="start"?"left":i==="end"?"right":"center",ht=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,sd=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function od(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:c,max:d,minDefined:u,maxDefined:h}=a.getUserBounds();u&&(s=gt(Math.min(de(r,l,c).lo,e?n:de(t,l,a.getPixelForValue(c)).lo),0,n-1)),h?o=gt(Math.max(de(r,a.axis,d,!0).hi+1,e?0:de(t,l,a.getPixelForValue(d),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function ad(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const fi=i=>i===0||i===1,ys=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*dt/e)),xs=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*dt/e)+1,Ue={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*lt)+1,easeOutSine:i=>Math.sin(i*lt),easeInOutSine:i=>-.5*(Math.cos(nt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>fi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>fi(i)?i:ys(i,.075,.3),easeOutElastic:i=>fi(i)?i:xs(i,.075,.3),easeInOutElastic(i){return fi(i)?i:i<.5?.5*ys(i*2,.1125,.45):.5+.5*xs(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ue.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ue.easeInBounce(i*2)*.5:Ue.easeOutBounce(i*2-1)*.5+.5};function Un(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vs(i){return Un(i)?i:new Ze(i)}function ln(i){return Un(i)?i:new Ze(i).saturate(.5).darken(.1).hexString()}const rd=["x","y","borderWidth","radius","tension"],ld=["color","borderColor","backgroundColor"];function cd(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:ld},numbers:{type:"number",properties:rd}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function dd(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ws=new Map;function ud(i,t){t=t||{};const e=i+JSON.stringify(t);let n=ws.get(e);return n||(n=new Intl.NumberFormat(i,t),ws.set(e,n)),n}function Aa(i,t,e){return ud(t,e).format(i)}const Ia={values(i){return st(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=hd(i,e)}const a=kn(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Aa(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(kn(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?Ia.numeric.call(this,i,t,e):""}};function hd(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ra={formatters:Ia};function fd(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ra.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const fe=Object.create(null),Mn=Object.create(null);function Xe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;nn.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>ln(s.backgroundColor),this.hoverBorderColor=(n,s)=>ln(s.borderColor),this.hoverColor=(n,s)=>ln(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return cn(this,t,e)}get(t){return Xe(this,t)}describe(t,e){return cn(Mn,t,e)}override(t,e){return cn(fe,t,e)}route(t,e,n,s){const o=Xe(this,t),a=Xe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return V(l)?Object.assign({},c,l):E(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new gd({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cd,dd,fd]);function pd(i){return!i||X(i.size)||X(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ks(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function oe(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Ss(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Pn(i,t,e,n){Fa(i,t,e,n,null)}function Fa(i,t,e,n,s){let o,a,r,l,c,d,u,h;const f=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*Uc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(p),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,m,0,0,dt):i.arc(e,n,m,0,dt),i.closePath();break;case"triangle":d=s?s/2:m,i.moveTo(e+Math.sin(p)*d,n-Math.cos(p)*m),p+=ps,i.lineTo(e+Math.sin(p)*d,n-Math.cos(p)*m),p+=ps,i.lineTo(e+Math.sin(p)*d,n-Math.cos(p)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(p+se)*l,u=Math.cos(p+se)*(s?s/2-c:l),r=Math.sin(p+se)*l,h=Math.sin(p+se)*(s?s/2-c:l),i.arc(e-u,n-r,c,p-nt,p-lt),i.arc(e+h,n-a,c,p-lt,p),i.arc(e+u,n+r,c,p,p+lt),i.arc(e-h,n+a,c,p+lt,p+nt),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,d=s?s/2:l,i.rect(e-d,n-l,2*d,2*l);break}p+=se;case"rectRot":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+h,n-a),i.lineTo(e+u,n+r),i.lineTo(e-h,n+a),i.closePath();break;case"crossRot":p+=se;case"cross":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a);break;case"star":u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a),p+=se,u=Math.cos(p)*(s?s/2:m),a=Math.cos(p)*m,r=Math.sin(p)*m,h=Math.sin(p)*(s?s/2:m),i.moveTo(e-u,n-r),i.lineTo(e+u,n+r),i.moveTo(e+h,n-a),i.lineTo(e-h,n+a);break;case"line":a=s?s/2:Math.cos(p)*m,r=Math.sin(p)*m,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(p)*(s?s/2:m),n+Math.sin(p)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ei(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,_d(i,o),l=0;l+i||0;function qn(i,t){const e={},n=V(t),s=n?Object.keys(t):t,o=V(i)?n?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=Sd(o(a));return e}function La(i){return qn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function ve(i){return qn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(i){const t=La(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ct(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=E(i.style,t.style);n&&!(""+n).match(wd)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:E(i.family,t.family),lineHeight:kd(E(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:E(i.weight,t.weight),string:""};return s.string=pd(s),s}function q(i,t,e,n){let s=!0,o,a,r;for(o=0,a=i.length;oe&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function me(i,t){return Object.assign(Object.create(i),t)}function Kn(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Va("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Kn([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return Ba(r,l,()=>Rd(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ps(r).includes(l)},ownKeys(r){return Ps(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function Me(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ea(i,n),setContext:o=>Me(i,o,e,n),override:o=>Me(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return Ba(o,a,()=>Cd(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Ea(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:ie(e)?e:()=>e,isIndexable:ie(n)?n:()=>n}}const Pd=(i,t)=>i?i+Nn(t):t,Jn=(i,t)=>V(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ba(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Cd(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return ie(r)&&a.isScriptable(t)&&(r=Dd(t,r,i,e)),st(r)&&r.length&&(r=Td(t,r,i,a.isIndexable)),Jn(t,r)&&(r=Me(r,s,o&&o[t],a)),r}function Dd(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Jn(i,l)&&(l=Qn(s._scopes,s,i,l)),l}function Td(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(V(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const u=Qn(c,s,i,d);t.push(Me(u,o,a&&a[i],r))}}return t}function za(i,t,e){return ie(i)?i(t,e):i}const Od=(i,t)=>i===!0?t:typeof i=="string"?Hi(t,i):void 0;function Ad(i,t,e,n,s){for(const o of t){const a=Od(e,o);if(a){i.add(a);const r=za(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Qn(i,t,e,n){const s=t._rootScopes,o=za(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=Ms(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ms(r,a,o,l,n),l===null)?!1:Kn(Array.from(r),[""],s,o,()=>Id(t,e,n))}function Ms(i,t,e,n,s){for(;e;)e=Ad(i,t,e,n,s);return e}function Id(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return st(s)&&V(e)?e:s||{}}function Rd(i,t,e,n){let s;for(const o of t)if(s=Va(Pd(o,i),e),typeof s<"u")return Jn(i,s)?Qn(e,n,i,s):s}function Va(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ps(i){let t=i._keys;return t||(t=i._keys=Fd(i._scopes)),t}function Fd(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}const Ld=Number.EPSILON||1e-14,Pe=(i,t)=>ti==="x"?"y":"x";function Ed(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Sn(o,s),l=Sn(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const u=n*c,h=n*d;return{previous:{x:o.x-u*(a.x-s.x),y:o.y-u*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function Bd(i,t,e){const n=i.length;let s,o,a,r,l,c=Pe(i,0);for(let d=0;d!c.skip)),t.cubicInterpolationMode==="monotone")Vd(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function Nd(i,t){return Qi(i).getPropertyValue(t)}const jd=["top","right","bottom","left"];function ue(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=jd[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const $d=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Yd(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if($d(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function re(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Qi(e),o=s.boxSizing==="border-box",a=ue(s,"padding"),r=ue(s,"border","width"),{x:l,y:c,box:d}=Yd(i,e),u=a.left+(d&&r.left),h=a.top+(d&&r.top);let{width:f,height:g}=t;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((c-h)/g*e.height/n)}}function Ud(i,t,e){let n,s;if(t===void 0||e===void 0){const o=ts(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Qi(o),l=ue(r,"border","width"),c=ue(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=$i(r.maxWidth,o,"clientWidth"),s=$i(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Ni,maxHeight:s||Ni}}const pi=i=>Math.round(i*10)/10;function Xd(i,t,e,n){const s=Qi(i),o=ue(s,"margin"),a=$i(s.maxWidth,i,"clientWidth")||Ni,r=$i(s.maxHeight,i,"clientHeight")||Ni,l=Ud(i,t,e);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const h=ue(s,"border","width"),f=ue(s,"padding");c-=f.width+h.width,d-=f.height+h.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?c/n:d-o.height),c=pi(Math.min(c,a,l.maxWidth)),d=pi(Math.min(d,r,l.maxHeight)),c&&!d&&(d=pi(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&d>l.height&&(d=l.height,c=pi(Math.floor(d*n))),{width:c,height:d}}function Cs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Gd=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Zn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ds(i,t){const e=Nd(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function le(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function qd(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Kd(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=le(i,s,e),r=le(s,o,e),l=le(o,t,e),c=le(a,r,e),d=le(r,l,e);return le(c,d,e)}const Jd=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Qd=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function we(i,t,e){return i?Jd(t,e):Qd()}function Wa(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Na(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ja(i){return i==="angle"?{between:jn,compare:Jc,normalize:Gt}:{between:Qt,compare:(t,e)=>t-e,normalize:t=>t}}function Ts({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Zd(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=ja(n),l=t.length;let{start:c,end:d,loop:u}=i,h,f;if(u){for(c+=l,d+=l,h=0,f=l;hl(s,w,_)&&r(s,w)!==0,v=()=>r(o,_)===0||l(o,w,_),C=()=>m||M(),P=()=>!m||v();for(let S=d,k=d;S<=u;++S)y=t[S%a],!y.skip&&(_=c(y[n]),_!==w&&(m=l(_,s,o),p===null&&C()&&(p=r(_,s)===0?S:k),p!==null&&P()&&(g.push(Ts({start:p,end:S,loop:h,count:a,style:f})),p=null),k=S,w=_));return p!==null&&g.push(Ts({start:p,end:u,loop:h,count:a,style:f})),g}function eu(i,t){const e=[],n=i.segments;for(let s=0;ss&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function nu(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function su(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=iu(e,s,o,n);if(n===!0)return Os(i,[{start:a,end:r,loop:o}],e,t);const l=rr({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ta.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Wt=new ru;const Is="transparent",lu={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=vs(i||Is),s=n.valid&&vs(t||Is);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class cu{constructor(t,e,n,s){const o=e[n];s=q([t.to,s,o,t.from]);const a=q([t.from,o,s]);this._active=!0,this._fn=t.fn||lu[t.type||typeof a],this._easing=Ue[t.easing]||Ue.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=q([t.to,e,s,t.from]),this._from=q([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s{const o=t[s];if(!V(o))return;const a={};for(const r of e)a[r]=o[r];(st(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=uu(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&du(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const d=e[c];let u=o[c];const h=n.get(c);if(u)if(h&&u.active()){u.update(h,d,r);continue}else u.cancel();if(!h||!h.duration){t[c]=d;continue}o[c]=u=new cu(h,t,c,d),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Wt.add(this._chart,n),!0}}function du(i,t){const e=[],n=Object.keys(t);for(let s=0;s0||!e&&o<0)return s.index}return null}function zs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,d=pu(o,a,n),u=t.length;let h;for(let f=0;fe[n].axis===t).shift()}function _u(i,t){return me(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yu(i,t,e){return me(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Re(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const un=i=>i==="reset"||i==="none",Bs=(i,t)=>t?i:Object.assign({},i),xu=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ya(e,!0),values:null};class Ge{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ls(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(u,h,f,g)=>u==="x"?h:u==="r"?g:f,o=e.xAxisID=E(n.xAxisID,dn(t,"x")),a=e.yAxisID=E(n.yAxisID,dn(t,"y")),r=e.rAxisID=E(n.rAxisID,dn(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),d=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_s(this._data,this),t._stacked&&Re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(V(e))this._data=gu(e);else if(n!==e){if(n){_s(n,this);const s=this._cachedMeta;Re(s),s._parsed=[]}e&&Object.isExtensible(e)&&ed(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=Ls(e.vScale,e),e.stack!==n.stack&&(s=!0,Re(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&zs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,u,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{st(s[t])?h=this.parseArrayData(n,s,t,e):V(s[t])?h=this.parseObjectData(n,s,t,e):h=this.parsePrimitiveData(n,s,t,e);const f=()=>u[r]===null||c&&u[r]m||u=0;--h)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s=0&&tthis.getContext(n,s,e),m=c.resolveNamedOptions(h,f,g,u);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(Bs(m,l))),m}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,e),h=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(h,this.getContext(t,n,e))}const c=new $a(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||un(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){un(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!un(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r0&&this.getParsed(e-1);for(let v=0;v=y){P.skip=!0;continue}const S=this.getParsed(v),k=X(S[f]),A=P[h]=a.getPixelForValue(S[h],v),D=P[f]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[f],v);P.skip=isNaN(A)||isNaN(D)||k,P.stop=v>0&&Math.abs(S[h]-M[h])>p,m&&(P.parsed=S,P.raw=c.data[v]),u&&(P.options=d||this.resolveDataElementOptions(v,C.active?"active":s)),_||this.updateElement(C,v,P,s),M=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(Ci,"id","line"),O(Ci,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(Ci,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function ae(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class es{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(es.prototype,t)}init(){}formats(){return ae()}parse(){return ae()}format(){return ae()}add(){return ae()}diff(){return ae()}startOf(){return ae()}endOf(){return ae()}}var Ua={_date:es};function vu(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Zc:de;if(n){if(s._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const u=l(o,t,e-d),h=l(o,t,e+d);return{lo:u.lo,hi:h.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function ri(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var Mu={evaluateInteractionItems:ri,modes:{index(i,t,e,n){const s=re(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?hn(i,s,o,n,a):fn(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(i,t,e,n){const s=re(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?hn(i,s,o,n,a):fn(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let d=0;de.pos===t)}function Hs(i,t){return i.filter(e=>Xa.indexOf(e.pos)===-1&&e.box.axis===t)}function Le(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Pu(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;ec.box.fullSize),!0),n=Le(Fe(t,"left"),!0),s=Le(Fe(t,"right")),o=Le(Fe(t,"top"),!0),a=Le(Fe(t,"bottom")),r=Hs(t,"x"),l=Hs(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Fe(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Ws(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Ga(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Ou(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!V(s)){e.size&&(i[s]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,i[s]+=e.size}o.getPadding&&Ga(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ws(a,i,"left","right")),l=Math.max(0,t.outerHeight-Ws(a,i,"top","bottom")),c=r!==i.w,d=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function Au(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Iu(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function He(i,t,e,n){const s=[];let o,a,r,l,c,d;for(o=0,a=i.length,c=0;o{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),h=Object.assign({},s);Ga(h,kt(n));const f=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),g=Du(l.concat(c),u);He(r.fullSize,f,u,g),He(l,f,u,g),He(c,f,u,g)&&He(l,f,u,g),Au(f),Ns(r.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Ns(r.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},N(r.chartArea,m=>{const p=m.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qa{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Ru extends qa{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Di="$chartjs",Fu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},js=i=>i===null||i==="";function Lu(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Di]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",js(s)){const o=Ds(i,"width");o!==void 0&&(i.width=o)}if(js(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ds(i,"height");o!==void 0&&(i.height=o)}return i}const Ka=Gd?{passive:!0}:!1;function Eu(i,t,e){i.addEventListener(t,e,Ka)}function zu(i,t,e){i.canvas.removeEventListener(t,e,Ka)}function Bu(i,t){const e=Fu[i.type]||i.type,{x:n,y:s}=re(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Yi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Vu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.addedNodes,n),a=a&&!Yi(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.removedNodes,n),a=a&&!Yi(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ni=new Map;let $s=0;function Ja(){const i=window.devicePixelRatio;i!==$s&&($s=i,ni.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Wu(i,t){ni.size||window.addEventListener("resize",Ja),ni.set(i,t)}function Nu(i){ni.delete(i),ni.size||window.removeEventListener("resize",Ja)}function ju(i,t,e){const n=i.canvas,s=n&&ts(n);if(!s)return;const o=Oa((r,l)=>{const c=s.clientWidth;e(r,l),c{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),Wu(i,o),a}function gn(i,t,e){e&&e.disconnect(),t==="resize"&&Nu(i)}function $u(i,t,e){const n=i.canvas,s=Oa(o=>{i.ctx!==null&&e(Bu(o,i))},i);return Eu(n,t,s),s}class Yu extends qa{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Lu(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Di])return!1;const n=e[Di].initial;["height","width"].forEach(o=>{const a=n[o];X(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Di],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Vu,detach:Hu,resize:ju}[e]||$u;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:gn,detach:gn,resize:gn}[e]||zu)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Xd(t,e,n,s)}isAttached(t){const e=ts(t);return!!(e&&e.isConnected)}}function Uu(i){return!Zn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ru:Yu}class At{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ti(this.x)&&ti(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}O(At,"defaults",{}),O(At,"defaultRoutes");function Xu(i,t){const e=i.options.ticks,n=Gu(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Ku(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Ju(t,c,o,a/s),c;const d=qu(o,t,s);if(a>0){let u,h;const f=a>1?Math.round((l-r)/(a-1)):null;for(bi(t,c,d,X(f)?0:r-f,r),u=0,h=a-1;us)return l}return Math.max(s,1)}function Ku(i){const t=[];let e,n;for(e=0,n=i.length;ei==="left"?"right":i==="right"?"left":i,Ys=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Us=(i,t)=>Math.min(t||i,i);function Xs(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;oa+r)))return l}function eh(i,t){N(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;on?n:e,n=s&&e>n?e:n,{min:Ft(e,Ft(n,e)),max:Ft(n,Ft(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Y(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Md(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,h=d.highest.height,f=gt(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/n:f/(n-1),u+6>r&&(r=f/(n-(t.offset?.5:1)),l=this.maxHeight-Ee(t.grid)-e.padding-Gs(t.title,this.chart.options.font),c=Math.sqrt(u*u+h*h),a=Kc(Math.min(Math.asin(gt((d.highest.height+6)/r,-1,1)),Math.asin(gt(l/c,-1,1))-Math.asin(gt(h/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Gs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ee(o)+l):(t.height=this.maxHeight,t.width=Ee(o)+l),n.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:h}=this._getLabelSizes(),f=n.padding*2,g=ce(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(r){const _=n.mirror?0:p*u.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=n.mirror?0:m*u.width+p*h.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,d,p,m)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=n*e.height):(h=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,f=e.width/2),this.paddingLeft=Math.max((h-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-u+a)*this.width/(this.width-u),0)}else{let d=e.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=e.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Y(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e({width:a[k]||0,height:r[k]||0});return{first:S(0),last:S(e-1),widest:S(C),highest:S(P),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Qc(this._alignToPixels?oe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*s?r/n:l/s:l*s0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),h=Ee(o),f=[],g=r.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,_=function(z){return oe(n,z,m)};let y,w,M,v,C,P,S,k,A,D,I,j;if(a==="top")y=_(this.bottom),P=this.bottom-h,k=y-p,D=_(t.top)+p,j=t.bottom;else if(a==="bottom")y=_(this.top),D=t.top,j=_(t.bottom)-p,P=y+p,k=this.top+h;else if(a==="left")y=_(this.right),C=this.right-h,S=y-p,A=_(t.left)+p,I=t.right;else if(a==="right")y=_(this.left),A=t.left,I=_(t.right)-p,C=y+p,S=this.left+h;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(V(a)){const z=Object.keys(a)[0],$=a[z];y=_(this.chart.scales[z].getPixelForValue($))}D=t.top,j=t.bottom,P=y+p,k=P+h}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(V(a)){const z=Object.keys(a)[0],$=a[z];y=_(this.chart.scales[z].getPixelForValue($))}C=y-p,S=C-h,A=t.left,I=t.right}const K=E(s.ticks.maxTicksLimit,u),L=Math.max(1,Math.ceil(u/K));for(w=0;w0&&(tt-=Dt/2);break}Ut={left:tt,top:ot,width:Dt+Rt.width,height:Bt+Rt.height,color:L.backdropColor}}p.push({label:M,font:k,textOffset:I,options:{rotation:m,color:$,strokeColor:mt,strokeWidth:it,textAlign:It,textBaseline:j,translation:[v,C],backdrop:Ut}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ce(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return e==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");Z.route(o,s,l,r)})}function lh(i){return"id"in i&&"defaults"in i}class ch{constructor(){this.controllers=new _i(Ge,"datasets",!0),this.elements=new _i(At,"elements"),this.plugins=new _i(Object,"plugins"),this.scales=new _i(Te,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):N(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Nn(t);Y(n["before"+s],[],n),e[t](n),Y(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;eo.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function uh(i){const t={},e=[],n=Object.keys(Et.plugins.items);for(let o=0;o1&&qs(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ks(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function _h(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Ks(i,"x",e[0])||Ks(i,"y",e[0])}return{}}function yh(i,t){const e=fe[i.type]||{scales:{}},n=t.scales||{},s=Cn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!V(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Dn(a,r,_h(a,i),Z.scales[r.type]),c=mh(l,s),d=e.scales||{};o[a]=$e(Object.create(null),[{axis:l},r,d[l],d[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Cn(r,t),d=(fe[r]||{}).scales||{};Object.keys(d).forEach(u=>{const h=ph(u,l),f=a[h+"AxisID"]||h;o[f]=o[f]||Object.create(null),$e(o[f],[{axis:h},n[f],d[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];$e(r,[Z.scales[r.type],Z.scale])}),o}function Qa(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=yh(i,t)}function Za(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function xh(i){return i=i||{},i.data=Za(i.data),Qa(i),i}const Js=new Map,tr=new Set;function yi(i,t){let e=Js.get(i);return e||(e=t(),Js.set(i,e),tr.add(e)),e}const ze=(i,t,e)=>{const n=Hi(t,e);n!==void 0&&i.add(n)};class vh{constructor(t){this._config=xh(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Za(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Qa(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return yi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(u=>ze(l,t,u))),d.forEach(u=>ze(l,s,u)),d.forEach(u=>ze(l,fe[o]||{},u)),d.forEach(u=>ze(l,Z,u)),d.forEach(u=>ze(l,Mn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tr.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,fe[e]||{},Z.datasets[e]||{},{type:e},Z,Mn]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Qs(this._resolverCache,t,s);let l=a;if(kh(a,e)){o.$shared=!1,n=ie(n)?n():n;const c=this.createResolver(t,n,r);l=Me(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Qs(this._resolverCache,t,n);return V(e)?Me(o,e,void 0,s):o}}function Qs(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Kn(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const wh=i=>V(i)&&Object.getOwnPropertyNames(i).some(t=>ie(i[t]));function kh(i,t){const{isScriptable:e,isIndexable:n}=Ea(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(ie(r)||wh(r))||a&&st(r))return!0}return!1}var Sh="4.4.1";const Mh=["top","bottom","left","right","chartArea"];function Zs(i,t){return i==="top"||i==="bottom"||Mh.indexOf(i)===-1&&t==="x"}function to(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function eo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[i],t)}function Ph(i){const t=i.chart,e=t.options.animation;Y(e&&e.onProgress,[i],t)}function er(i){return Zn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ti={},io=i=>{const t=er(i);return Object.values(Ti).filter(e=>e.canvas===t).pop()};function Ch(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function Dh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function xi(i,t,e){return i.options.clip?i[e]:t[e]}function Th(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:xi(e,t,"left"),right:xi(e,t,"right"),top:xi(n,t,"top"),bottom:xi(n,t,"bottom")}:t}var Xt;let Zi=(Xt=class{static register(...t){Et.add(...t),no()}static unregister(...t){Et.remove(...t),no()}constructor(t,e){const n=this.config=new vh(e),s=er(t),o=io(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Uu(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Bc(),this.ctx=r,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new dh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nd(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Ti[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Wt.listen(this,"complete",eo),Wt.listen(this,"progress",Ph),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return X(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Et}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ss(this.canvas,this.ctx),this}stop(){return Wt.stop(this),this}resize(t,e){Wt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Cs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),Y(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};N(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Dn(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),N(o,a=>{const r=a.options,l=r.id,c=Dn(l,r),d=E(r.type,a.dtype);(r.position===void 0||Zs(r.position,c)!==Zs(a.dposition))&&(r.position=a.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===d)u=n[l];else{const h=Et.getScale(d);u=new h({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(r,t)}),N(s,(a,r)=>{a||delete n[r]}),N(n,a=>{Pt.configure(this,a,a.options),Pt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;se.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(to("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){N(this.scales,t=>{Pt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!gs(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;Ch(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Pt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],N(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=Th(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Xn(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&Gn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return ei(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Mu.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Wi(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Wt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};N(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){N(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},N(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Bi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=$c(t),c=Dh(t,this._lastEvent,n,l);n&&(this._lastEvent=null,Y(o.onHover,[t,r,this],this),l&&Y(o.onClick,[t,r,this],this));const d=!Bi(r,s);return(d||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},O(Xt,"defaults",Z),O(Xt,"instances",Ti),O(Xt,"overrides",fe),O(Xt,"registry",Et),O(Xt,"version",Sh),O(Xt,"getChart",io),Xt);function no(){return N(Zi.instances,i=>i._plugins.invalidate())}function Oh(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+lt,n-lt),i.closePath(),i.clip()}function Ah(i){return qn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Ih(i,t,e,n){const s=Ah(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return gt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:gt(s.innerStart,0,a),innerEnd:gt(s.innerEnd,0,a)}}function ye(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ui(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+e-c,0),h=d>0?d+n+e+c:0;let f=0;const g=s-l;if(n){const L=d>0?d-n:0,z=u>0?u-n:0,$=(L+z)/2,mt=$!==0?g*$/($+n):g;f=(g-mt)/2}const m=Math.max(.001,g*u-e/nt)/u,p=(g-m)/2,_=l+p+f,y=s-p-f,{outerStart:w,outerEnd:M,innerStart:v,innerEnd:C}=Ih(t,h,u,y-_),P=u-w,S=u-M,k=_+w/P,A=y-M/S,D=h+v,I=h+C,j=_+v/D,K=y-C/I;if(i.beginPath(),o){const L=(k+A)/2;if(i.arc(a,r,u,k,L),i.arc(a,r,u,L,A),M>0){const it=ye(S,A,a,r);i.arc(it.x,it.y,M,A,y+lt)}const z=ye(I,y,a,r);if(i.lineTo(z.x,z.y),C>0){const it=ye(I,K,a,r);i.arc(it.x,it.y,C,y+lt,K+Math.PI)}const $=(y-C/h+(_+v/h))/2;if(i.arc(a,r,h,y-C/h,$,!0),i.arc(a,r,h,$,_+v/h,!0),v>0){const it=ye(D,j,a,r);i.arc(it.x,it.y,v,j+Math.PI,_-lt)}const mt=ye(P,_,a,r);if(i.lineTo(mt.x,mt.y),w>0){const it=ye(P,k,a,r);i.arc(it.x,it.y,w,_-lt,k)}}else{i.moveTo(a,r);const L=Math.cos(k)*u+a,z=Math.sin(k)*u+r;i.lineTo(L,z);const $=Math.cos(A)*u+a,mt=Math.sin(A)*u+r;i.lineTo($,mt)}i.closePath()}function Rh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Ui(i,t,e,n,l,s);for(let c=0;c=dt||jn(a,l,c),p=Qt(r,d+f,u+f);return m&&p}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:d}=this.options,u=(o+a)/2,h=(r+l+d+c)/2;return{x:n+Math.cos(u)*h,y:s+Math.sin(u)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>dt?Math.floor(s/dt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(nt,s||0)),d=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Rh(e,this,d,a,r),Fh(e,this,d,a,r),e.restore()}}O(We,"id","arc"),O(We,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),O(We,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(We,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ir(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function Lh(i,t,e){i.lineTo(e.x,e.y)}function Eh(i){return i.stepped?md:i.tension||i.cubicInterpolationMode==="monotone"?bd:Lh}function nr(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=sr&&o>r;return{count:n,start:l,loop:t.loop,ilen:c(a+(c?r-M:M))%o,w=()=>{m!==p&&(i.lineTo(d,p),i.lineTo(d,m),i.lineTo(d,_))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),h=0;h<=r;++h){if(f=s[y(h)],f.skip)continue;const M=f.x,v=f.y,C=M|0;C===g?(vp&&(p=v),d=(u*d+M)/++u):(w(),i.lineTo(M,v),g=C,u=0,m=p=v),_=v}w()}function Tn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Bh:zh}function Vh(i){return i.stepped?qd:i.tension||i.cubicInterpolationMode==="monotone"?Kd:le}function Hh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ir(i,t.options),i.stroke(s)}function Wh(i,t,e,n){const{segments:s,options:o}=t,a=Tn(t);for(const r of s)ir(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Nh=typeof Path2D=="function";function jh(i,t,e,n){Nh&&!t.options.segment?Hh(i,t,e,n):Wh(i,t,e,n)}class Ne extends At{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Wd(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=su(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=eu(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Vh(n);let c,d;for(c=0,d=a.length;ct!=="borderDash"&&t!=="fill"});function so(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o){let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},qh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ao extends At{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Y(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=ct(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=oo(n,o);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let u=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-d;return this.legendItems.forEach((g,m)=>{const p=n+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+p+2*r>a)&&(u+=d,c[c.length-(m>0?0:1)]=0,f+=d,h++),l[m]={left:0,top:f,row:h,width:p,height:s},c[c.length-1]+=p+r}),u}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let u=r,h=0,f=0,g=0,m=0;return this.legendItems.forEach((p,_)=>{const{itemWidth:y,itemHeight:w}=Kh(n,e,o,p,s);_>0&&f+w+2*r>d&&(u+=h+r,c.push({width:h,height:f}),g+=h+r,m++,h=f=0),l[_]={left:g,top:f,col:m,width:y,height:w},h=Math.max(h,y),f+=w+r}),u+=h,c.push({width:h,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=we(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=ht(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=ht(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=ht(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=ht(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Xn(t,this),this._draw(),Gn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,l=we(t.rtl,this.left,this.width),c=ct(a.font),{padding:d}=a,u=c.size,h=u/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=oo(a,u),_=function(C,P,S){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const k=E(S.lineWidth,1);if(s.fillStyle=E(S.fillStyle,r),s.lineCap=E(S.lineCap,"butt"),s.lineDashOffset=E(S.lineDashOffset,0),s.lineJoin=E(S.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=E(S.strokeStyle,r),s.setLineDash(E(S.lineDash,[])),a.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:k},D=l.xPlus(C,g/2),I=P+h;Fa(s,A,D,I,a.pointStyleWidth&&g)}else{const A=P+Math.max((u-m)/2,0),D=l.leftForLtr(C,g),I=ve(S.borderRadius);s.beginPath(),Object.values(I).some(j=>j!==0)?ji(s,{x:D,y:A,w:g,h:m,radius:I}):s.rect(D,A,g,m),s.fill(),k!==0&&s.stroke()}s.restore()},y=function(C,P,S){ii(s,S.text,C,P+p/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},w=this.isHorizontal(),M=this._computeTitleHeight();w?f={x:ht(o,this.left+d,this.right-n[0]),y:this.top+d+M,line:0}:f={x:this.left+d,y:ht(o,this.top+M+d,this.bottom-e[0].height),line:0},Wa(this.ctx,t.textDirection);const v=p+d;this.legendItems.forEach((C,P)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const S=s.measureText(C.text).width,k=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),A=g+h+S;let D=f.x,I=f.y;l.setWidth(this.width),w?P>0&&D+A+d>this.right&&(I=f.y+=v,f.line++,D=f.x=ht(o,this.left+d,this.right-n[f.line])):P>0&&I+v>this.bottom&&(D=f.x=D+e[f.line].width+d,f.line++,I=f.y=ht(o,this.top+M+d,this.bottom-e[f.line].height));const j=l.x(D);if(_(j,I,C),D=sd(k,D+g+h,w?D+A:this.right,t.rtl),y(l.x(D),I,C),w)f.x+=A+d;else if(typeof C.text!="string"){const K=c.lineHeight;f.y+=or(C,K)+d}else f.y+=v}),Na(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=ct(e.font),s=kt(e.padding);if(!e.display)return;const o=we(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let d,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+c,u=ht(t.align,u,this.right-h);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);d=c+ht(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=ht(r,u,u+h);a.textAlign=o.textAlign(Yn(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,ii(a,e.text,f,d,n)}_computeTitleHeight(){const t=this.options.title,e=ct(t.font),n=kt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Qt(t,this.left,this.right)&&Qt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;no.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Qh(i,t,e){let n=i;return typeof t.text!="string"&&(n=or(t,e)),n}function or(i,t){const e=i.text?i.text.length:0;return t*e}function Zh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var tf={id:"legend",_element:ao,start(i,t,e){const n=i.legend=new ao({ctx:i.ctx,options:e,chart:i});Pt.configure(i,n,e),Pt.addBox(i,n)},stop(i){Pt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Pt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),d=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ar extends At{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=st(n.text)?n.text.length:1;this._padding=kt(n.padding);const o=s*ct(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,u;return this.isHorizontal()?(d=ht(r,n,o),u=e+t,c=o-n):(a.position==="left"?(d=n+t,u=ht(r,s,e),l=nt*-.5):(d=o-t,u=ht(r,e,s),l=nt*.5),c=s-e),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=ct(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);ii(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Yn(e.align),textBaseline:"middle",translation:[a,r]})}}function ef(i,t){const e=new ar({ctx:i.ctx,options:t,chart:i});Pt.configure(i,e,t),Pt.addBox(i,e),i.titleBlock=e}var nf={id:"title",_element:ar,start(i,t,e){ef(i,e)},stop(i){const t=i.titleBlock;Pt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;Pt.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const je={average(i){if(!i.length)return!1;let t,e,n=0,s=0,o=0;for(t=0,e=i.length;tr({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ta.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Wt=new ru;const Is="transparent",lu={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=vs(i||Is),s=n.valid&&vs(t||Is);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class cu{constructor(t,e,n,s){const o=e[n];s=q([t.to,s,o,t.from]);const a=q([t.from,o,s]);this._active=!0,this._fn=t.fn||lu[t.type||typeof a],this._easing=Ue[t.easing]||Ue.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=q([t.to,e,s,t.from]),this._from=q([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s{const o=t[s];if(!V(o))return;const a={};for(const r of e)a[r]=o[r];(st(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=uu(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&du(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const d=e[c];let u=o[c];const h=n.get(c);if(u)if(h&&u.active()){u.update(h,d,r);continue}else u.cancel();if(!h||!h.duration){t[c]=d;continue}o[c]=u=new cu(h,t,c,d),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Wt.add(this._chart,n),!0}}function du(i,t){const e=[],n=Object.keys(t);for(let s=0;s0||!e&&o<0)return s.index}return null}function Bs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,d=pu(o,a,n),u=t.length;let h;for(let f=0;fe[n].axis===t).shift()}function _u(i,t){return me(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yu(i,t,e){return me(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Re(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const un=i=>i==="reset"||i==="none",zs=(i,t)=>t?i:Object.assign({},i),xu=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ya(e,!0),values:null};class Ge{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ls(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(u,h,f,g)=>u==="x"?h:u==="r"?g:f,o=e.xAxisID=E(n.xAxisID,dn(t,"x")),a=e.yAxisID=E(n.yAxisID,dn(t,"y")),r=e.rAxisID=E(n.rAxisID,dn(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),d=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_s(this._data,this),t._stacked&&Re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(V(e))this._data=gu(e);else if(n!==e){if(n){_s(n,this);const s=this._cachedMeta;Re(s),s._parsed=[]}e&&Object.isExtensible(e)&&ed(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=Ls(e.vScale,e),e.stack!==n.stack&&(s=!0,Re(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&Bs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,u,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{st(s[t])?h=this.parseArrayData(n,s,t,e):V(s[t])?h=this.parseObjectData(n,s,t,e):h=this.parsePrimitiveData(n,s,t,e);const f=()=>u[r]===null||c&&u[r]m||u=0;--h)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s=0&&tthis.getContext(n,s,e),m=c.resolveNamedOptions(h,f,g,u);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(zs(m,l))),m}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,e),h=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(h,this.getContext(t,n,e))}const c=new $a(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||un(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){un(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!un(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r0&&this.getParsed(e-1);for(let v=0;v=y){P.skip=!0;continue}const S=this.getParsed(v),k=X(S[f]),A=P[h]=a.getPixelForValue(S[h],v),D=P[f]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[f],v);P.skip=isNaN(A)||isNaN(D)||k,P.stop=v>0&&Math.abs(S[h]-M[h])>p,m&&(P.parsed=S,P.raw=c.data[v]),u&&(P.options=d||this.resolveDataElementOptions(v,C.active?"active":s)),_||this.updateElement(C,v,P,s),M=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(Ci,"id","line"),O(Ci,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(Ci,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function ae(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class es{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(es.prototype,t)}init(){}formats(){return ae()}parse(){return ae()}format(){return ae()}add(){return ae()}diff(){return ae()}startOf(){return ae()}endOf(){return ae()}}var Ua={_date:es};function vu(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Zc:de;if(n){if(s._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const u=l(o,t,e-d),h=l(o,t,e+d);return{lo:u.lo,hi:h.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function ri(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var Mu={evaluateInteractionItems:ri,modes:{index(i,t,e,n){const s=re(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?hn(i,s,o,n,a):fn(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(i,t,e,n){const s=re(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?hn(i,s,o,n,a):fn(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let d=0;de.pos===t)}function Hs(i,t){return i.filter(e=>Xa.indexOf(e.pos)===-1&&e.box.axis===t)}function Le(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Pu(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;ec.box.fullSize),!0),n=Le(Fe(t,"left"),!0),s=Le(Fe(t,"right")),o=Le(Fe(t,"top"),!0),a=Le(Fe(t,"bottom")),r=Hs(t,"x"),l=Hs(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Fe(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Ws(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Ga(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Ou(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!V(s)){e.size&&(i[s]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,i[s]+=e.size}o.getPadding&&Ga(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ws(a,i,"left","right")),l=Math.max(0,t.outerHeight-Ws(a,i,"top","bottom")),c=r!==i.w,d=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function Au(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Iu(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function He(i,t,e,n){const s=[];let o,a,r,l,c,d;for(o=0,a=i.length,c=0;o{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),h=Object.assign({},s);Ga(h,kt(n));const f=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),g=Du(l.concat(c),u);He(r.fullSize,f,u,g),He(l,f,u,g),He(c,f,u,g)&&He(l,f,u,g),Au(f),Ns(r.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Ns(r.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},N(r.chartArea,m=>{const p=m.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qa{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Ru extends qa{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Di="$chartjs",Fu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},js=i=>i===null||i==="";function Lu(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Di]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",js(s)){const o=Ds(i,"width");o!==void 0&&(i.width=o)}if(js(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ds(i,"height");o!==void 0&&(i.height=o)}return i}const Ka=Gd?{passive:!0}:!1;function Eu(i,t,e){i.addEventListener(t,e,Ka)}function Bu(i,t,e){i.canvas.removeEventListener(t,e,Ka)}function zu(i,t){const e=Fu[i.type]||i.type,{x:n,y:s}=re(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Yi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Vu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.addedNodes,n),a=a&&!Yi(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.removedNodes,n),a=a&&!Yi(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ni=new Map;let $s=0;function Ja(){const i=window.devicePixelRatio;i!==$s&&($s=i,ni.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Wu(i,t){ni.size||window.addEventListener("resize",Ja),ni.set(i,t)}function Nu(i){ni.delete(i),ni.size||window.removeEventListener("resize",Ja)}function ju(i,t,e){const n=i.canvas,s=n&&ts(n);if(!s)return;const o=Oa((r,l)=>{const c=s.clientWidth;e(r,l),c{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),Wu(i,o),a}function gn(i,t,e){e&&e.disconnect(),t==="resize"&&Nu(i)}function $u(i,t,e){const n=i.canvas,s=Oa(o=>{i.ctx!==null&&e(zu(o,i))},i);return Eu(n,t,s),s}class Yu extends qa{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Lu(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Di])return!1;const n=e[Di].initial;["height","width"].forEach(o=>{const a=n[o];X(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Di],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Vu,detach:Hu,resize:ju}[e]||$u;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:gn,detach:gn,resize:gn}[e]||Bu)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Xd(t,e,n,s)}isAttached(t){const e=ts(t);return!!(e&&e.isConnected)}}function Uu(i){return!Zn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ru:Yu}class At{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ti(this.x)&&ti(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}O(At,"defaults",{}),O(At,"defaultRoutes");function Xu(i,t){const e=i.options.ticks,n=Gu(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Ku(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Ju(t,c,o,a/s),c;const d=qu(o,t,s);if(a>0){let u,h;const f=a>1?Math.round((l-r)/(a-1)):null;for(bi(t,c,d,X(f)?0:r-f,r),u=0,h=a-1;us)return l}return Math.max(s,1)}function Ku(i){const t=[];let e,n;for(e=0,n=i.length;ei==="left"?"right":i==="right"?"left":i,Ys=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Us=(i,t)=>Math.min(t||i,i);function Xs(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;oa+r)))return l}function eh(i,t){N(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;on?n:e,n=s&&e>n?e:n,{min:Ft(e,Ft(n,e)),max:Ft(n,Ft(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Y(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Md(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,h=d.highest.height,f=gt(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/n:f/(n-1),u+6>r&&(r=f/(n-(t.offset?.5:1)),l=this.maxHeight-Ee(t.grid)-e.padding-Gs(t.title,this.chart.options.font),c=Math.sqrt(u*u+h*h),a=Kc(Math.min(Math.asin(gt((d.highest.height+6)/r,-1,1)),Math.asin(gt(l/c,-1,1))-Math.asin(gt(h/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Gs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ee(o)+l):(t.height=this.maxHeight,t.width=Ee(o)+l),n.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:h}=this._getLabelSizes(),f=n.padding*2,g=ce(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(r){const _=n.mirror?0:p*u.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=n.mirror?0:m*u.width+p*h.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,d,p,m)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=n*e.height):(h=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,f=e.width/2),this.paddingLeft=Math.max((h-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-u+a)*this.width/(this.width-u),0)}else{let d=e.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=e.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Y(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e({width:a[k]||0,height:r[k]||0});return{first:S(0),last:S(e-1),widest:S(C),highest:S(P),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Qc(this._alignToPixels?oe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*s?r/n:l/s:l*s0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),h=Ee(o),f=[],g=r.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,_=function(B){return oe(n,B,m)};let y,w,M,v,C,P,S,k,A,D,I,j;if(a==="top")y=_(this.bottom),P=this.bottom-h,k=y-p,D=_(t.top)+p,j=t.bottom;else if(a==="bottom")y=_(this.top),D=t.top,j=_(t.bottom)-p,P=y+p,k=this.top+h;else if(a==="left")y=_(this.right),C=this.right-h,S=y-p,A=_(t.left)+p,I=t.right;else if(a==="right")y=_(this.left),A=t.left,I=_(t.right)-p,C=y+p,S=this.left+h;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(V(a)){const B=Object.keys(a)[0],$=a[B];y=_(this.chart.scales[B].getPixelForValue($))}D=t.top,j=t.bottom,P=y+p,k=P+h}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(V(a)){const B=Object.keys(a)[0],$=a[B];y=_(this.chart.scales[B].getPixelForValue($))}C=y-p,S=C-h,A=t.left,I=t.right}const K=E(s.ticks.maxTicksLimit,u),L=Math.max(1,Math.ceil(u/K));for(w=0;w0&&(tt-=Dt/2);break}Ut={left:tt,top:ot,width:Dt+Rt.width,height:zt+Rt.height,color:L.backdropColor}}p.push({label:M,font:k,textOffset:I,options:{rotation:m,color:$,strokeColor:mt,strokeWidth:it,textAlign:It,textBaseline:j,translation:[v,C],backdrop:Ut}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ce(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return e==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");Z.route(o,s,l,r)})}function lh(i){return"id"in i&&"defaults"in i}class ch{constructor(){this.controllers=new _i(Ge,"datasets",!0),this.elements=new _i(At,"elements"),this.plugins=new _i(Object,"plugins"),this.scales=new _i(Te,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):N(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Nn(t);Y(n["before"+s],[],n),e[t](n),Y(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;eo.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function uh(i){const t={},e=[],n=Object.keys(Et.plugins.items);for(let o=0;o1&&qs(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ks(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function _h(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Ks(i,"x",e[0])||Ks(i,"y",e[0])}return{}}function yh(i,t){const e=fe[i.type]||{scales:{}},n=t.scales||{},s=Cn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!V(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Dn(a,r,_h(a,i),Z.scales[r.type]),c=mh(l,s),d=e.scales||{};o[a]=$e(Object.create(null),[{axis:l},r,d[l],d[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Cn(r,t),d=(fe[r]||{}).scales||{};Object.keys(d).forEach(u=>{const h=ph(u,l),f=a[h+"AxisID"]||h;o[f]=o[f]||Object.create(null),$e(o[f],[{axis:h},n[f],d[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];$e(r,[Z.scales[r.type],Z.scale])}),o}function Qa(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=yh(i,t)}function Za(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function xh(i){return i=i||{},i.data=Za(i.data),Qa(i),i}const Js=new Map,tr=new Set;function yi(i,t){let e=Js.get(i);return e||(e=t(),Js.set(i,e),tr.add(e)),e}const Be=(i,t,e)=>{const n=Hi(t,e);n!==void 0&&i.add(n)};class vh{constructor(t){this._config=xh(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Za(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Qa(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return yi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(u=>Be(l,t,u))),d.forEach(u=>Be(l,s,u)),d.forEach(u=>Be(l,fe[o]||{},u)),d.forEach(u=>Be(l,Z,u)),d.forEach(u=>Be(l,Mn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tr.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,fe[e]||{},Z.datasets[e]||{},{type:e},Z,Mn]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Qs(this._resolverCache,t,s);let l=a;if(kh(a,e)){o.$shared=!1,n=ie(n)?n():n;const c=this.createResolver(t,n,r);l=Me(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Qs(this._resolverCache,t,n);return V(e)?Me(o,e,void 0,s):o}}function Qs(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Kn(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const wh=i=>V(i)&&Object.getOwnPropertyNames(i).some(t=>ie(i[t]));function kh(i,t){const{isScriptable:e,isIndexable:n}=Ea(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(ie(r)||wh(r))||a&&st(r))return!0}return!1}var Sh="4.4.1";const Mh=["top","bottom","left","right","chartArea"];function Zs(i,t){return i==="top"||i==="bottom"||Mh.indexOf(i)===-1&&t==="x"}function to(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function eo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[i],t)}function Ph(i){const t=i.chart,e=t.options.animation;Y(e&&e.onProgress,[i],t)}function er(i){return Zn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ti={},io=i=>{const t=er(i);return Object.values(Ti).filter(e=>e.canvas===t).pop()};function Ch(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function Dh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function xi(i,t,e){return i.options.clip?i[e]:t[e]}function Th(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:xi(e,t,"left"),right:xi(e,t,"right"),top:xi(n,t,"top"),bottom:xi(n,t,"bottom")}:t}var Xt;let Zi=(Xt=class{static register(...t){Et.add(...t),no()}static unregister(...t){Et.remove(...t),no()}constructor(t,e){const n=this.config=new vh(e),s=er(t),o=io(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Uu(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=zc(),this.ctx=r,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new dh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nd(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Ti[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Wt.listen(this,"complete",eo),Wt.listen(this,"progress",Ph),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return X(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Et}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ss(this.canvas,this.ctx),this}stop(){return Wt.stop(this),this}resize(t,e){Wt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Cs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),Y(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};N(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Dn(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),N(o,a=>{const r=a.options,l=r.id,c=Dn(l,r),d=E(r.type,a.dtype);(r.position===void 0||Zs(r.position,c)!==Zs(a.dposition))&&(r.position=a.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===d)u=n[l];else{const h=Et.getScale(d);u=new h({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(r,t)}),N(s,(a,r)=>{a||delete n[r]}),N(n,a=>{Pt.configure(this,a,a.options),Pt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;se.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(to("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){N(this.scales,t=>{Pt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!gs(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;Ch(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Pt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],N(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=Th(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Xn(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&Gn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return ei(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Mu.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Wi(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Wt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};N(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){N(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},N(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!zi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=$c(t),c=Dh(t,this._lastEvent,n,l);n&&(this._lastEvent=null,Y(o.onHover,[t,r,this],this),l&&Y(o.onClick,[t,r,this],this));const d=!zi(r,s);return(d||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},O(Xt,"defaults",Z),O(Xt,"instances",Ti),O(Xt,"overrides",fe),O(Xt,"registry",Et),O(Xt,"version",Sh),O(Xt,"getChart",io),Xt);function no(){return N(Zi.instances,i=>i._plugins.invalidate())}function Oh(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+lt,n-lt),i.closePath(),i.clip()}function Ah(i){return qn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Ih(i,t,e,n){const s=Ah(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return gt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:gt(s.innerStart,0,a),innerEnd:gt(s.innerEnd,0,a)}}function ye(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ui(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+e-c,0),h=d>0?d+n+e+c:0;let f=0;const g=s-l;if(n){const L=d>0?d-n:0,B=u>0?u-n:0,$=(L+B)/2,mt=$!==0?g*$/($+n):g;f=(g-mt)/2}const m=Math.max(.001,g*u-e/nt)/u,p=(g-m)/2,_=l+p+f,y=s-p-f,{outerStart:w,outerEnd:M,innerStart:v,innerEnd:C}=Ih(t,h,u,y-_),P=u-w,S=u-M,k=_+w/P,A=y-M/S,D=h+v,I=h+C,j=_+v/D,K=y-C/I;if(i.beginPath(),o){const L=(k+A)/2;if(i.arc(a,r,u,k,L),i.arc(a,r,u,L,A),M>0){const it=ye(S,A,a,r);i.arc(it.x,it.y,M,A,y+lt)}const B=ye(I,y,a,r);if(i.lineTo(B.x,B.y),C>0){const it=ye(I,K,a,r);i.arc(it.x,it.y,C,y+lt,K+Math.PI)}const $=(y-C/h+(_+v/h))/2;if(i.arc(a,r,h,y-C/h,$,!0),i.arc(a,r,h,$,_+v/h,!0),v>0){const it=ye(D,j,a,r);i.arc(it.x,it.y,v,j+Math.PI,_-lt)}const mt=ye(P,_,a,r);if(i.lineTo(mt.x,mt.y),w>0){const it=ye(P,k,a,r);i.arc(it.x,it.y,w,_-lt,k)}}else{i.moveTo(a,r);const L=Math.cos(k)*u+a,B=Math.sin(k)*u+r;i.lineTo(L,B);const $=Math.cos(A)*u+a,mt=Math.sin(A)*u+r;i.lineTo($,mt)}i.closePath()}function Rh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Ui(i,t,e,n,l,s);for(let c=0;c=dt||jn(a,l,c),p=Qt(r,d+f,u+f);return m&&p}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:d}=this.options,u=(o+a)/2,h=(r+l+d+c)/2;return{x:n+Math.cos(u)*h,y:s+Math.sin(u)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>dt?Math.floor(s/dt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(nt,s||0)),d=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Rh(e,this,d,a,r),Fh(e,this,d,a,r),e.restore()}}O(We,"id","arc"),O(We,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),O(We,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(We,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function ir(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function Lh(i,t,e){i.lineTo(e.x,e.y)}function Eh(i){return i.stepped?md:i.tension||i.cubicInterpolationMode==="monotone"?bd:Lh}function nr(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=sr&&o>r;return{count:n,start:l,loop:t.loop,ilen:c(a+(c?r-M:M))%o,w=()=>{m!==p&&(i.lineTo(d,p),i.lineTo(d,m),i.lineTo(d,_))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),h=0;h<=r;++h){if(f=s[y(h)],f.skip)continue;const M=f.x,v=f.y,C=M|0;C===g?(vp&&(p=v),d=(u*d+M)/++u):(w(),i.lineTo(M,v),g=C,u=0,m=p=v),_=v}w()}function Tn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?zh:Bh}function Vh(i){return i.stepped?qd:i.tension||i.cubicInterpolationMode==="monotone"?Kd:le}function Hh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ir(i,t.options),i.stroke(s)}function Wh(i,t,e,n){const{segments:s,options:o}=t,a=Tn(t);for(const r of s)ir(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Nh=typeof Path2D=="function";function jh(i,t,e,n){Nh&&!t.options.segment?Hh(i,t,e,n):Wh(i,t,e,n)}class Ne extends At{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Wd(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=su(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=eu(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Vh(n);let c,d;for(c=0,d=a.length;ct!=="borderDash"&&t!=="fill"});function so(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o){let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},qh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ao extends At{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Y(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=ct(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=oo(n,o);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let u=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-d;return this.legendItems.forEach((g,m)=>{const p=n+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+p+2*r>a)&&(u+=d,c[c.length-(m>0?0:1)]=0,f+=d,h++),l[m]={left:0,top:f,row:h,width:p,height:s},c[c.length-1]+=p+r}),u}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let u=r,h=0,f=0,g=0,m=0;return this.legendItems.forEach((p,_)=>{const{itemWidth:y,itemHeight:w}=Kh(n,e,o,p,s);_>0&&f+w+2*r>d&&(u+=h+r,c.push({width:h,height:f}),g+=h+r,m++,h=f=0),l[_]={left:g,top:f,col:m,width:y,height:w},h=Math.max(h,y),f+=w+r}),u+=h,c.push({width:h,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=we(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=ht(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=ht(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=ht(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=ht(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Xn(t,this),this._draw(),Gn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,l=we(t.rtl,this.left,this.width),c=ct(a.font),{padding:d}=a,u=c.size,h=u/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=oo(a,u),_=function(C,P,S){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const k=E(S.lineWidth,1);if(s.fillStyle=E(S.fillStyle,r),s.lineCap=E(S.lineCap,"butt"),s.lineDashOffset=E(S.lineDashOffset,0),s.lineJoin=E(S.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=E(S.strokeStyle,r),s.setLineDash(E(S.lineDash,[])),a.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:k},D=l.xPlus(C,g/2),I=P+h;Fa(s,A,D,I,a.pointStyleWidth&&g)}else{const A=P+Math.max((u-m)/2,0),D=l.leftForLtr(C,g),I=ve(S.borderRadius);s.beginPath(),Object.values(I).some(j=>j!==0)?ji(s,{x:D,y:A,w:g,h:m,radius:I}):s.rect(D,A,g,m),s.fill(),k!==0&&s.stroke()}s.restore()},y=function(C,P,S){ii(s,S.text,C,P+p/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},w=this.isHorizontal(),M=this._computeTitleHeight();w?f={x:ht(o,this.left+d,this.right-n[0]),y:this.top+d+M,line:0}:f={x:this.left+d,y:ht(o,this.top+M+d,this.bottom-e[0].height),line:0},Wa(this.ctx,t.textDirection);const v=p+d;this.legendItems.forEach((C,P)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const S=s.measureText(C.text).width,k=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),A=g+h+S;let D=f.x,I=f.y;l.setWidth(this.width),w?P>0&&D+A+d>this.right&&(I=f.y+=v,f.line++,D=f.x=ht(o,this.left+d,this.right-n[f.line])):P>0&&I+v>this.bottom&&(D=f.x=D+e[f.line].width+d,f.line++,I=f.y=ht(o,this.top+M+d,this.bottom-e[f.line].height));const j=l.x(D);if(_(j,I,C),D=sd(k,D+g+h,w?D+A:this.right,t.rtl),y(l.x(D),I,C),w)f.x+=A+d;else if(typeof C.text!="string"){const K=c.lineHeight;f.y+=or(C,K)+d}else f.y+=v}),Na(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=ct(e.font),s=kt(e.padding);if(!e.display)return;const o=we(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let d,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+c,u=ht(t.align,u,this.right-h);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);d=c+ht(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=ht(r,u,u+h);a.textAlign=o.textAlign(Yn(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,ii(a,e.text,f,d,n)}_computeTitleHeight(){const t=this.options.title,e=ct(t.font),n=kt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Qt(t,this.left,this.right)&&Qt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;no.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Qh(i,t,e){let n=i;return typeof t.text!="string"&&(n=or(t,e)),n}function or(i,t){const e=i.text?i.text.length:0;return t*e}function Zh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var tf={id:"legend",_element:ao,start(i,t,e){const n=i.legend=new ao({ctx:i.ctx,options:e,chart:i});Pt.configure(i,n,e),Pt.addBox(i,n)},stop(i){Pt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Pt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),d=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ar extends At{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=st(n.text)?n.text.length:1;this._padding=kt(n.padding);const o=s*ct(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,u;return this.isHorizontal()?(d=ht(r,n,o),u=e+t,c=o-n):(a.position==="left"?(d=n+t,u=ht(r,s,e),l=nt*-.5):(d=o-t,u=ht(r,e,s),l=nt*.5),c=s-e),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=ct(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);ii(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Yn(e.align),textBaseline:"middle",translation:[a,r]})}}function ef(i,t){const e=new ar({ctx:i.ctx,options:t,chart:i});Pt.configure(i,e,t),Pt.addBox(i,e),i.titleBlock=e}var nf={id:"title",_element:ar,start(i,t,e){ef(i,e)},stop(i){const t=i.titleBlock;Pt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;Pt.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const je={average(i){if(!i.length)return!1;let t,e,n=0,s=0,o=0;for(t=0,e=i.length;t-1?i.split(` -`):i}function sf(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ro(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=ct(t.bodyFont),c=ct(t.titleFont),d=ct(t.footerFont),u=o.length,h=s.length,f=n.length,g=kt(t.padding);let m=g.height,p=0,_=n.reduce((M,v)=>M+v.before.length+v.lines.length+v.after.length,0);if(_+=i.beforeBody.length+i.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const M=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=f*M+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let y=0;const w=function(M){p=Math.max(p,e.measureText(M).width+y)};return e.save(),e.font=c.string,N(i.title,w),e.font=l.string,N(i.beforeBody.concat(i.afterBody),w),y=t.displayColors?a+2+t.boxPadding:0,N(n,M=>{N(M.before,w),N(M.lines,w),N(M.after,w)}),y=0,e.font=d.string,N(i.footer,w),e.restore(),p+=g.width,{width:p,height:m}}function of(i,t){const{y:e,height:n}=t;return ei.height-n/2?"bottom":"center"}function af(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function rf(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),af(c,i,t,e)&&(c="center"),c}function lo(i,t,e){const n=e.yAlign||t.yAlign||of(i,e);return{xAlign:e.xAlign||t.xAlign||rf(i,t,e,n),yAlign:n}}function lf(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function cf(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function co(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:f}=ve(a);let g=lf(t,r);const m=cf(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(d,h)+s:r==="right"&&(g+=Math.max(u,f)+s),{x:gt(g,0,n.width-t.width),y:gt(m,0,n.height-t.height)}}function vi(i,t,e){const n=kt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function uo(i){return Lt([],Nt(i))}function df(i,t,e){return me(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ho(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const rr={beforeTitle:Ht,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?rr[t].call(e,n):s}class On extends At{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new $a(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=df(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=_t(n,"beforeTitle",this,t),o=_t(n,"title",this,t),a=_t(n,"afterTitle",this,t);let r=[];return r=Lt(r,Nt(s)),r=Lt(r,Nt(o)),r=Lt(r,Nt(a)),r}getBeforeBody(t,e){return uo(_t(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return N(t,o=>{const a={before:[],lines:[],after:[]},r=ho(n,o);Lt(a.before,Nt(_t(r,"beforeLabel",this,o))),Lt(a.lines,_t(r,"label",this,o)),Lt(a.after,Nt(_t(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return uo(_t(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=_t(n,"beforeFooter",this,t),o=_t(n,"footer",this,t),a=_t(n,"afterFooter",this,t);let r=[];return r=Lt(r,Nt(s)),r=Lt(r,Nt(o)),r=Lt(r,Nt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;lt.filter(d,u,h,n))),t.itemSort&&(r=r.sort((d,u)=>t.itemSort(d,u,n))),N(r,d=>{const u=ho(t.callbacks,d);s.push(_t(u,"labelColor",this,d)),o.push(_t(u,"labelPointStyle",this,d)),a.push(_t(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=je[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=ro(this,n),c=Object.assign({},r,l),d=lo(this.chart,n,c),u=co(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=ve(r),{x:h,y:f}=t,{width:g,height:m}=e;let p,_,y,w,M,v;return o==="center"?(M=f+m/2,s==="left"?(p=h,_=p-a,w=M+a,v=M-a):(p=h+g,_=p+a,w=M-a,v=M+a),y=p):(s==="left"?_=h+Math.max(l,d)+a:s==="right"?_=h+g-Math.max(c,u)-a:_=this.caretX,o==="top"?(w=f,M=w-a,p=_-a,y=_+a):(w=f+m,M=w+a,p=_+a,y=_-a),v=w),{x1:p,x2:_,x3:y,y1:w,y2:M,y3:v}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const c=we(n.rtl,this.x,this.width);for(t.x=vi(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=ct(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ji(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ji(t,{x:p,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=ct(n.bodyFont);let h=u.lineHeight,f=0;const g=we(n.rtl,this.x,this.width),m=function(S){e.fillText(S,g.x(t.x+f),t.y+h/2),t.y+=h+o},p=g.textAlign(a);let _,y,w,M,v,C,P;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=vi(this,p,n),e.fillStyle=n.bodyColor,N(this.beforeBody,m),f=r&&p!=="right"?a==="center"?c/2+d:c+2+d:0,M=0,C=s.length;M0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=je[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ro(this,t),l=Object.assign({},a,this._size),c=lo(e,t,l),d=co(t,l,c,e);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=kt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),Wa(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Na(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!Bi(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!Bi(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=je[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}O(On,"positioners",je);var uf={id:"tooltip",_element:On,positioners:je,afterInit(i,t,e){e&&(i.tooltip=new On({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:rr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const hf=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ff(i,t,e,n){const s=i.indexOf(t);if(s===-1)return hf(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const gf=(i,t)=>i===null?null:gt(Math.round(i),0,t);function fo(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(An,"id","category"),O(An,"defaults",{ticks:{callback:fo}});function pf(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:h}=i,f=o||1,g=d-1,{min:m,max:p}=t,_=!X(a),y=!X(r),w=!X(c),M=(p-m)/(u+1);let v=ms((p-m)/g/f)*f,C,P,S,k;if(v<1e-14&&!_&&!y)return[{value:m},{value:p}];k=Math.ceil(p/v)-Math.floor(m/v),k>g&&(v=ms(k*v/g/f)*f),X(l)||(C=Math.pow(10,l),v=Math.ceil(v*C)/C),s==="ticks"?(P=Math.floor(m/v)*v,S=Math.ceil(p/v)*v):(P=m,S=p),_&&y&&o&&Gc((r-a)/o,v/1e3)?(k=Math.round(Math.min((r-a)/v,d)),v=(r-a)/k,P=a,S=r):w?(P=_?a:P,S=y?r:S,k=c-1,v=(S-P)/k):(k=(S-P)/v,Ye(k,Math.round(k),v/1e3)?k=Math.round(k):k=Math.ceil(k));const A=Math.max(bs(v),bs(P));C=Math.pow(10,X(l)?A:l),P=Math.round(P*C)/C,S=Math.round(S*C)/C;let D=0;for(_&&(h&&P!==a?(e.push({value:a}),Pr)break;e.push({value:I})}return y&&h&&S!==r?e.length&&Ye(e[e.length-1].value,r,go(r,M,i))?e[e.length-1].value=r:e.push({value:r}):(!y||S===r)&&e.push({value:S}),e}function go(i,t,{horizontal:e,minRotation:n}){const s=ce(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class mf extends Te{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=Se(s),c=Se(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=pf(s,o);return t.bounds==="ticks"&&qc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Aa(t,this.chart.options.locale,this.options.ticks.format)}}class In extends mf{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Ct(t)?t:0,this.max=Ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ce(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(In,"id","linear"),O(In,"defaults",{ticks:{callback:Ra.formatters.numeric}});const tn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(tn);function po(i,t){return i-t}function mo(i,t){if(X(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),Ct(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ti(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function bo(i,t,e,n){const s=xt.length;for(let o=xt.indexOf(i);o=xt.indexOf(e);o--){const a=xt[o];if(tn[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return xt[e?xt.indexOf(e):0]}function _f(i){for(let t=xt.indexOf(i)+1,e=xt.length;t=t?e[n]:e[s];i[o]=!0}}function yf(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function yo(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=gt(e,0,a),n=gt(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||bo(o.minUnit,e,n,this._getLabelCapacity(e)),r=E(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ti(l)||l===!0,d={};let u=e,h,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(h=u,f=0;h+m)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return Y(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],u=c&&r[c],h=n[e],f=c&&u&&h&&h.major;return this._adapter.format(t,s||(f?u:d))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=de(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=de(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class xo extends si{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=wi(e,this.min),this._tableRange=wi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;as-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(wi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return wi(this._table,n*this._tableRange+this._minPos,!0)}}O(xo,"id","timeseries"),O(xo,"defaults",si.defaults);const lr={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xf={ariaLabel:{type:String},ariaDescribedby:{type:String}},vf={type:{type:String,required:!0},...lr,...xf},wf=Wr[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function xe(i){return Lo(i)?xn(i):i}function kf(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return Lo(t)?new Proxy(i,{}):i}function Sf(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function cr(i,t){i.labels=t}function dr(i,t,e){const n=[];i.datasets=t.map(s=>{const o=i.datasets.find(a=>a[e]===s[e]);return!o||!s.data||n.includes(o)?{...s}:(n.push(o),Object.assign(o,s),o)})}function Mf(i,t){const e={labels:[],datasets:[]};return cr(e,i.labels),dr(e,i.datasets,t),e}const Pf=Fo({props:vf,setup(i,t){let{expose:e,slots:n}=t;const s=J(null),o=Ii(null);e({chart:o});const a=()=>{if(!s.value)return;const{type:c,data:d,options:u,plugins:h,datasetIdKey:f}=i,g=Mf(d,f),m=kf(g,d);o.value=new Zi(s.value,{type:c,data:m,options:{...u},plugins:h})},r=()=>{const c=xn(o.value);c&&(c.destroy(),o.value=null)},l=c=>{c.update(i.updateMode)};return Nr(a),jr(r),oi([()=>i.options,()=>i.data],(c,d)=>{let[u,h]=c,[f,g]=d;const m=xn(o.value);if(!m)return;let p=!1;if(u){const _=xe(u),y=xe(f);_&&_!==y&&(Sf(m,_),p=!0)}if(h){const _=xe(h.labels),y=xe(g.labels),w=xe(h.datasets),M=xe(g.datasets);_!==y&&(cr(m.config.data,_),p=!0),w&&w!==M&&(dr(m.config.data,w,i.datasetIdKey),p=!0)}p&&$r(()=>{l(m)})},{deep:!0}),()=>yn("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:s},[yn("p",{},[n.default?n.default():""])])}});function Cf(i,t){return Zi.register(t),Fo({props:lr,setup(e,n){let{expose:s}=n;const o=Ii(null),a=r=>{o.value=r==null?void 0:r.chart};return s({chart:o}),()=>yn(Pf,wf({ref:a},{type:i,...e}))}})}const Df=Cf("line",Ci);/*! +`):i}function sf(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ro(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=ct(t.bodyFont),c=ct(t.titleFont),d=ct(t.footerFont),u=o.length,h=s.length,f=n.length,g=kt(t.padding);let m=g.height,p=0,_=n.reduce((M,v)=>M+v.before.length+v.lines.length+v.after.length,0);if(_+=i.beforeBody.length+i.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const M=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=f*M+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let y=0;const w=function(M){p=Math.max(p,e.measureText(M).width+y)};return e.save(),e.font=c.string,N(i.title,w),e.font=l.string,N(i.beforeBody.concat(i.afterBody),w),y=t.displayColors?a+2+t.boxPadding:0,N(n,M=>{N(M.before,w),N(M.lines,w),N(M.after,w)}),y=0,e.font=d.string,N(i.footer,w),e.restore(),p+=g.width,{width:p,height:m}}function of(i,t){const{y:e,height:n}=t;return ei.height-n/2?"bottom":"center"}function af(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function rf(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),af(c,i,t,e)&&(c="center"),c}function lo(i,t,e){const n=e.yAlign||t.yAlign||of(i,e);return{xAlign:e.xAlign||t.xAlign||rf(i,t,e,n),yAlign:n}}function lf(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function cf(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function co(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:f}=ve(a);let g=lf(t,r);const m=cf(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(d,h)+s:r==="right"&&(g+=Math.max(u,f)+s),{x:gt(g,0,n.width-t.width),y:gt(m,0,n.height-t.height)}}function vi(i,t,e){const n=kt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function uo(i){return Lt([],Nt(i))}function df(i,t,e){return me(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ho(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const rr={beforeTitle:Ht,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?rr[t].call(e,n):s}class On extends At{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new $a(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=df(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=_t(n,"beforeTitle",this,t),o=_t(n,"title",this,t),a=_t(n,"afterTitle",this,t);let r=[];return r=Lt(r,Nt(s)),r=Lt(r,Nt(o)),r=Lt(r,Nt(a)),r}getBeforeBody(t,e){return uo(_t(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return N(t,o=>{const a={before:[],lines:[],after:[]},r=ho(n,o);Lt(a.before,Nt(_t(r,"beforeLabel",this,o))),Lt(a.lines,_t(r,"label",this,o)),Lt(a.after,Nt(_t(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return uo(_t(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=_t(n,"beforeFooter",this,t),o=_t(n,"footer",this,t),a=_t(n,"afterFooter",this,t);let r=[];return r=Lt(r,Nt(s)),r=Lt(r,Nt(o)),r=Lt(r,Nt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;lt.filter(d,u,h,n))),t.itemSort&&(r=r.sort((d,u)=>t.itemSort(d,u,n))),N(r,d=>{const u=ho(t.callbacks,d);s.push(_t(u,"labelColor",this,d)),o.push(_t(u,"labelPointStyle",this,d)),a.push(_t(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=je[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=ro(this,n),c=Object.assign({},r,l),d=lo(this.chart,n,c),u=co(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=ve(r),{x:h,y:f}=t,{width:g,height:m}=e;let p,_,y,w,M,v;return o==="center"?(M=f+m/2,s==="left"?(p=h,_=p-a,w=M+a,v=M-a):(p=h+g,_=p+a,w=M-a,v=M+a),y=p):(s==="left"?_=h+Math.max(l,d)+a:s==="right"?_=h+g-Math.max(c,u)-a:_=this.caretX,o==="top"?(w=f,M=w-a,p=_-a,y=_+a):(w=f+m,M=w+a,p=_+a,y=_-a),v=w),{x1:p,x2:_,x3:y,y1:w,y2:M,y3:v}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const c=we(n.rtl,this.x,this.width);for(t.x=vi(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=ct(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ji(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ji(t,{x:p,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=ct(n.bodyFont);let h=u.lineHeight,f=0;const g=we(n.rtl,this.x,this.width),m=function(S){e.fillText(S,g.x(t.x+f),t.y+h/2),t.y+=h+o},p=g.textAlign(a);let _,y,w,M,v,C,P;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=vi(this,p,n),e.fillStyle=n.bodyColor,N(this.beforeBody,m),f=r&&p!=="right"?a==="center"?c/2+d:c+2+d:0,M=0,C=s.length;M0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=je[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ro(this,t),l=Object.assign({},a,this._size),c=lo(e,t,l),d=co(t,l,c,e);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=kt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),Wa(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Na(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!zi(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!zi(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=je[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}O(On,"positioners",je);var uf={id:"tooltip",_element:On,positioners:je,afterInit(i,t,e){e&&(i.tooltip=new On({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:rr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const hf=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ff(i,t,e,n){const s=i.indexOf(t);if(s===-1)return hf(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const gf=(i,t)=>i===null?null:gt(Math.round(i),0,t);function fo(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(An,"id","category"),O(An,"defaults",{ticks:{callback:fo}});function pf(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:h}=i,f=o||1,g=d-1,{min:m,max:p}=t,_=!X(a),y=!X(r),w=!X(c),M=(p-m)/(u+1);let v=ms((p-m)/g/f)*f,C,P,S,k;if(v<1e-14&&!_&&!y)return[{value:m},{value:p}];k=Math.ceil(p/v)-Math.floor(m/v),k>g&&(v=ms(k*v/g/f)*f),X(l)||(C=Math.pow(10,l),v=Math.ceil(v*C)/C),s==="ticks"?(P=Math.floor(m/v)*v,S=Math.ceil(p/v)*v):(P=m,S=p),_&&y&&o&&Gc((r-a)/o,v/1e3)?(k=Math.round(Math.min((r-a)/v,d)),v=(r-a)/k,P=a,S=r):w?(P=_?a:P,S=y?r:S,k=c-1,v=(S-P)/k):(k=(S-P)/v,Ye(k,Math.round(k),v/1e3)?k=Math.round(k):k=Math.ceil(k));const A=Math.max(bs(v),bs(P));C=Math.pow(10,X(l)?A:l),P=Math.round(P*C)/C,S=Math.round(S*C)/C;let D=0;for(_&&(h&&P!==a?(e.push({value:a}),Pr)break;e.push({value:I})}return y&&h&&S!==r?e.length&&Ye(e[e.length-1].value,r,go(r,M,i))?e[e.length-1].value=r:e.push({value:r}):(!y||S===r)&&e.push({value:S}),e}function go(i,t,{horizontal:e,minRotation:n}){const s=ce(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class mf extends Te{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=Se(s),c=Se(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=pf(s,o);return t.bounds==="ticks"&&qc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Aa(t,this.chart.options.locale,this.options.ticks.format)}}class In extends mf{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Ct(t)?t:0,this.max=Ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ce(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(In,"id","linear"),O(In,"defaults",{ticks:{callback:Ra.formatters.numeric}});const tn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(tn);function po(i,t){return i-t}function mo(i,t){if(X(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),Ct(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ti(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function bo(i,t,e,n){const s=xt.length;for(let o=xt.indexOf(i);o=xt.indexOf(e);o--){const a=xt[o];if(tn[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return xt[e?xt.indexOf(e):0]}function _f(i){for(let t=xt.indexOf(i)+1,e=xt.length;t=t?e[n]:e[s];i[o]=!0}}function yf(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function yo(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=gt(e,0,a),n=gt(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||bo(o.minUnit,e,n,this._getLabelCapacity(e)),r=E(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ti(l)||l===!0,d={};let u=e,h,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(h=u,f=0;h+m)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return Y(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],u=c&&r[c],h=n[e],f=c&&u&&h&&h.major;return this._adapter.format(t,s||(f?u:d))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=de(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=de(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class xo extends si{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=wi(e,this.min),this._tableRange=wi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;as-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(wi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return wi(this._table,n*this._tableRange+this._minPos,!0)}}O(xo,"id","timeseries"),O(xo,"defaults",si.defaults);const lr={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xf={ariaLabel:{type:String},ariaDescribedby:{type:String}},vf={type:{type:String,required:!0},...lr,...xf},wf=Wr[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function xe(i){return Lo(i)?xn(i):i}function kf(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return Lo(t)?new Proxy(i,{}):i}function Sf(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function cr(i,t){i.labels=t}function dr(i,t,e){const n=[];i.datasets=t.map(s=>{const o=i.datasets.find(a=>a[e]===s[e]);return!o||!s.data||n.includes(o)?{...s}:(n.push(o),Object.assign(o,s),o)})}function Mf(i,t){const e={labels:[],datasets:[]};return cr(e,i.labels),dr(e,i.datasets,t),e}const Pf=Fo({props:vf,setup(i,t){let{expose:e,slots:n}=t;const s=J(null),o=Ii(null);e({chart:o});const a=()=>{if(!s.value)return;const{type:c,data:d,options:u,plugins:h,datasetIdKey:f}=i,g=Mf(d,f),m=kf(g,d);o.value=new Zi(s.value,{type:c,data:m,options:{...u},plugins:h})},r=()=>{const c=xn(o.value);c&&(c.destroy(),o.value=null)},l=c=>{c.update(i.updateMode)};return Nr(a),jr(r),oi([()=>i.options,()=>i.data],(c,d)=>{let[u,h]=c,[f,g]=d;const m=xn(o.value);if(!m)return;let p=!1;if(u){const _=xe(u),y=xe(f);_&&_!==y&&(Sf(m,_),p=!0)}if(h){const _=xe(h.labels),y=xe(g.labels),w=xe(h.datasets),M=xe(g.datasets);_!==y&&(cr(m.config.data,_),p=!0),w&&w!==M&&(dr(m.config.data,w,i.datasetIdKey),p=!0)}p&&$r(()=>{l(m)})},{deep:!0}),()=>yn("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:s},[yn("p",{},[n.default?n.default():""])])}});function Cf(i,t){return Zi.register(t),Fo({props:lr,setup(e,n){let{expose:s}=n;const o=Ii(null),a=r=>{o.value=r==null?void 0:r.chart};return s({chart:o}),()=>yn(Pf,wf({ref:a},{type:i,...e}))}})}const Df=Cf("line",Ci);/*! * chartjs-plugin-datalabels v2.2.0 * https://chartjs-plugin-datalabels.netlify.app * (c) 2017-2022 chartjs-plugin-datalabels contributors * Released under the MIT license */var vo=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var i=window.screen;if(i)return(i.deviceXDPI||1)/(i.logicalXDPI||1)}return 1}(),Ke={toTextLines:function(i){var t=[],e;for(i=[].concat(i);i.length;)e=i.pop(),typeof e=="string"?t.unshift.apply(t,e.split(` -`)):Array.isArray(e)?i.push.apply(i,e):X(i)||t.unshift(""+e);return t},textSize:function(i,t,e){var n=[].concat(t),s=n.length,o=i.font,a=0,r;for(i.font=e.string,r=0;re.right&&(n|=hr),te.bottom&&(n|=fr),n}function Af(i,t){for(var e=i.x0,n=i.y0,s=i.x1,o=i.y1,a=ki(e,n,t),r=ki(s,o,t),l,c,d;!(!(a|r)||a&r);)l=a||r,l&gr?(c=e+(s-e)*(t.top-n)/(o-n),d=t.top):l&fr?(c=e+(s-e)*(t.bottom-n)/(o-n),d=t.bottom):l&hr?(d=n+(o-n)*(t.right-e)/(s-e),c=t.right):l&ur&&(d=n+(o-n)*(t.left-e)/(s-e),c=t.left),l===a?(e=c,n=d,a=ki(e,n,t)):(s=c,o=d,r=ki(s,o,t));return{x0:e,x1:s,y0:n,y1:o}}function Si(i,t){var e=t.anchor,n=i,s,o;return t.clamp&&(n=Af(n,t.area)),e==="start"?(s=n.x0,o=n.y0):e==="end"?(s=n.x1,o=n.y1):(s=(n.x0+n.x1)/2,o=(n.y0+n.y1)/2),Tf(s,o,i.vx,i.vy,t.align)}var Mi={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,n=Math.cos(e),s=Math.sin(e),o=i.innerRadius,a=i.outerRadius;return Si({x0:i.x+n*o,y0:i.y+s*o,x1:i.x+n*a,y1:i.y+s*a,vx:n,vy:s},t)},point:function(i,t){var e=bn(i,t.origin),n=e.x*i.options.radius,s=e.y*i.options.radius;return Si({x0:i.x-n,y0:i.y-s,x1:i.x+n,y1:i.y+s,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=bn(i,t.origin),n=i.x,s=i.y,o=0,a=0;return i.horizontal?(n=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(s=Math.min(i.y,i.base),a=Math.abs(i.base-i.y)),Si({x0:n,y0:s+a,x1:n+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=bn(i,t.origin);return Si({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},$t=Ke.rasterize;function If(i){var t=i.borderWidth||0,e=i.padding,n=i.size.height,s=i.size.width,o=-s/2,a=-n/2;return{frame:{x:o-e.left-t,y:a-e.top-t,w:s+e.width+t*2,h:n+e.height+t*2},text:{x:o,y:a,w:s,h:n}}}function Rf(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var n=e.getBasePixel();return i.horizontal?{x:n,y:null}:{x:null,y:n}}function Ff(i){return i instanceof We?Mi.arc:i instanceof qe?Mi.point:i instanceof Oi?Mi.bar:Mi.fallback}function Lf(i,t,e,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=t+r,c=e+r,d=t+n-r,u=e+s-r;i.moveTo(t,c),ln.x+n.w+e*2||i.y>n.y+n.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),n=[Pi(t[0],t[1]),Pi(t[0],t[3])],s,o,a;for(this._rotation!==i._rotation&&n.push(Pi(e[0],e[1]),Pi(e[0],e[3])),s=0;s=0;--e)for(s=i[e].$layout,n=e-1;n>=0&&s._visible;--n)o=i[n].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return i}function jf(i){var t,e,n,s,o,a,r;for(t=0,e=i.length;tl.getProps([c],!0)[c]}),o=n.geometry(),a=br(r,n.model(),o),s._box.update(a,o,n.rotation()));return Nf(i,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=!1:d&&(l._visible=!1)})}var Je={prepare:function(i){var t=[],e,n,s,o,a;for(e=0,s=i.length;e=0;--e)if(n=i[e].$layout,n&&n._visible&&n._box.contains(t))return i[e];return null},draw:function(i,t){var e,n,s,o,a,r;for(e=0,n=t.length;ee.right&&(n|=hr),te.bottom&&(n|=fr),n}function Af(i,t){for(var e=i.x0,n=i.y0,s=i.x1,o=i.y1,a=ki(e,n,t),r=ki(s,o,t),l,c,d;!(!(a|r)||a&r);)l=a||r,l&gr?(c=e+(s-e)*(t.top-n)/(o-n),d=t.top):l&fr?(c=e+(s-e)*(t.bottom-n)/(o-n),d=t.bottom):l&hr?(d=n+(o-n)*(t.right-e)/(s-e),c=t.right):l&ur&&(d=n+(o-n)*(t.left-e)/(s-e),c=t.left),l===a?(e=c,n=d,a=ki(e,n,t)):(s=c,o=d,r=ki(s,o,t));return{x0:e,x1:s,y0:n,y1:o}}function Si(i,t){var e=t.anchor,n=i,s,o;return t.clamp&&(n=Af(n,t.area)),e==="start"?(s=n.x0,o=n.y0):e==="end"?(s=n.x1,o=n.y1):(s=(n.x0+n.x1)/2,o=(n.y0+n.y1)/2),Tf(s,o,i.vx,i.vy,t.align)}var Mi={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,n=Math.cos(e),s=Math.sin(e),o=i.innerRadius,a=i.outerRadius;return Si({x0:i.x+n*o,y0:i.y+s*o,x1:i.x+n*a,y1:i.y+s*a,vx:n,vy:s},t)},point:function(i,t){var e=bn(i,t.origin),n=e.x*i.options.radius,s=e.y*i.options.radius;return Si({x0:i.x-n,y0:i.y-s,x1:i.x+n,y1:i.y+s,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=bn(i,t.origin),n=i.x,s=i.y,o=0,a=0;return i.horizontal?(n=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(s=Math.min(i.y,i.base),a=Math.abs(i.base-i.y)),Si({x0:n,y0:s+a,x1:n+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=bn(i,t.origin);return Si({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},$t=Ke.rasterize;function If(i){var t=i.borderWidth||0,e=i.padding,n=i.size.height,s=i.size.width,o=-s/2,a=-n/2;return{frame:{x:o-e.left-t,y:a-e.top-t,w:s+e.width+t*2,h:n+e.height+t*2},text:{x:o,y:a,w:s,h:n}}}function Rf(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var n=e.getBasePixel();return i.horizontal?{x:n,y:null}:{x:null,y:n}}function Ff(i){return i instanceof We?Mi.arc:i instanceof qe?Mi.point:i instanceof Oi?Mi.bar:Mi.fallback}function Lf(i,t,e,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=t+r,c=e+r,d=t+n-r,u=e+s-r;i.moveTo(t,c),ln.x+n.w+e*2||i.y>n.y+n.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),n=[Pi(t[0],t[1]),Pi(t[0],t[3])],s,o,a;for(this._rotation!==i._rotation&&n.push(Pi(e[0],e[1]),Pi(e[0],e[3])),s=0;s=0;--e)for(s=i[e].$layout,n=e-1;n>=0&&s._visible;--n)o=i[n].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return i}function jf(i){var t,e,n,s,o,a,r;for(t=0,e=i.length;tl.getProps([c],!0)[c]}),o=n.geometry(),a=br(r,n.model(),o),s._box.update(a,o,n.rotation()));return Nf(i,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=!1:d&&(l._visible=!1)})}var Je={prepare:function(i){var t=[],e,n,s,o,a;for(e=0,s=i.length;e=0;--e)if(n=i[e].$layout,n&&n._visible&&n._box.contains(t))return i[e];return null},draw:function(i,t){var e,n,s,o,a,r;for(e=0,n=t.length;e{}},period:{type:Object,default:()=>{}},filter:{type:String,default:"d"}},setup(i,{emit:t}){const e=Gi(),n=J(0),s={datasets:[{label:"Открыто страниц",backgroundColor:"#C62828",borderColor:"#C62828",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>g.count,datakey:"count",tooltips:!1,hidden:!0,yAxisID:"y"},{label:"Активные пользователи",backgroundColor:"teal",borderColor:"teal",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>g.unic.length,datakey:"unic",customlabel:[],tooltips:!0,yAxisID:"y"},{label:"CRR",backgroundColor:"#673AB7",borderColor:"#673AB7",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:(g,m)=>parseFloat(l(m).toFixed(2)),hidden:!0,datakey:"crr",customlabel:[],tooltips:!0,yAxisID:"y1"},{label:"BR",backgroundColor:"#283593",borderColor:"#283593",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>parseFloat((g.br/g.unic.length*100).toFixed(2)),datakey:"br",hidden:!0,customlabel:[],tooltips:!0,yAxisID:"y1"},{label:"PPV",backgroundColor:"#EF9A9A",borderColor:"#EF9A9A",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>parseFloat((g.pages/g.unic.length).toFixed(2)),datakey:"ppv",hidden:!0,customlabel:[],tooltips:!0,yAxisID:"y"}]},o=B({get(){r();let g=at(e.date_period.enddate),m=at(e.date_period.startdate);n.value=g.diff(m,"days")+1;let p=null;if(Object.keys(i.dataLineChart).length>0){p=s,p.labels=[],p.datasets.forEach(_=>{_.data=[]});for(let[_,y]of Object.entries(i.dataLineChart))p.datasets.forEach(w=>{w.data.push(w.func(y,_))}),p.labels.push(Ro(_))}return p}}),a=J([]),r=()=>{let g=[];i.period.period.forEach(m=>{let p=g.findIndex(_=>_.visitdate==m.visitdate);p==-1?g.push({visitdate:m.visitdate,user:Array.from(new Set([m.user.id]))}):g[p].user=Array.from(new Set(g[p].user).add(m.user.id))}),a.value=[...i.period.before,...g]},l=g=>{let m=d(a.value.filter(y=>new Date(y.visitdate)>at(new Date(g)).subtract(n.value*2,"d")&&new Date(y.visitdate)<=at(new Date(g)).subtract(n.value,"d"))),p=d(a.value.filter(y=>new Date(y.visitdate)>at(new Date(g)).subtract(n.value,"d")&&new Date(y.visitdate)<=new Date(g))),_=new Set([...m].filter(y=>p.has(y)));return g==Ot(e.date_period.enddate)&&c(_.size*100/m.size),m.size==0?0:_.size*100/m.size},c=g=>{t("getCRR",g)},d=g=>{let m=[];return g.forEach(p=>m.push(...p.user)),new Set(m)},u=B({get(){return JSON.parse(JSON.stringify(o.value))}}),h=J(null);return{data:u,options:{plugins:{datalabels:{color:"grey",align:"top",display:"auto"},legend:{onHover:(g,m)=>{g.native.target.style.cursor="pointer"},onLeave:(g,m)=>{g.native.target.style.cursor="default"},position:"bottom",labels:{color:"grey",align:"right"}}},layout:{padding:{top:35,bottom:5,left:20,right:15}},scales:{x:{grid:{color:"white"}},y:{ticks:{stepSize:10},offset:!0,grid:{color:"white"}},y1:{type:"linear",display:!0,position:"right"}},responsive:!0,maintainAspectRatio:!1},linear:h}}};function Zf(i,t,e,n,s,o){const a=G("Line");return R(),H(ge,{class:"h-100"},{default:x(()=>[n.data!==null?(R(),H(a,{key:0,data:n.data,ref:"linear",options:n.options},null,8,["data","options"])):Qe("",!0)]),_:1})}const tg=ut(Qf,[["render",Zf]]),eg={props:{info:{type:Object,default:()=>({tooltip:"",ico:"",color:""})}},setup(i){return{}}};function ig(i,t,e,n,s,o){return R(),H(Yt,{location:"top"},{activator:x(({props:a})=>[T("span",Ri(Fi(a)),[b(wt,{class:"cursor-help",size:"large",color:e.info.color,icon:e.info.ico},null,8,["color","icon"])],16)]),default:x(()=>[b(U,null,{default:x(()=>[b(F,null,{default:x(()=>[Q(W(e.info.tooltip),1)]),_:1})]),_:1})]),_:1})}const ng=ut(eg,[["render",ig]]),sg={props:{info:{type:Array,default:()=>[]}}};function og(i,t,e,n,s,o){return R(),H(Yt,{location:"top"},{activator:x(({props:a})=>[T("span",Ri(Fi(a)),W(e.info.length),17)]),default:x(()=>[(R(!0),ft(vt,null,ee(e.info,a=>(R(),H(U,{"no-gutters":"",key:a},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(a),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})}const ag=ut(sg,[["render",og]]);const rg={components:{PatternCard:qi,TooltipIco:ng,TooltipUser:ag},props:{alldata:{type:Object,default:()=>({period:[],staff:0})}},setup(i){const t=Gi();return{traffic:B({get(){let o={user:{tooltip:"Уникальные пользователи",today:[],period:[],ico:"mdi-account-box",color:"indigo"},proc:{tooltip:"% от штата",today:0,period:0,ico:"mdi-chart-pie",color:"green"},before:{tooltip:"По сравнению предыдущим периодом",today:"",period:0,ico:"mdi-elevation-rise",color:"pink-darken-4"}};i.alldata.period.forEach(c=>{c.visitdate==Ot(new Date)&&os(o.user.today,Kt(c.user)),new Date(c.visitdate)<=t.date_period.enddate&&os(o.user.period,Kt(c.user))}),o.proc.today=parseFloat((o.user.today.length*100/i.alldata.staff).toFixed(2)),o.proc.period=parseFloat((o.user.period.length*100/i.alldata.staff).toFixed(2));let a=at(t.date_period.enddate),r=at(t.date_period.startdate),l=a.diff(r,"days")+1;return i.alldata.beforperiod.filter(c=>r.diff(at(c.visitdate),"days")(o.before.period+=d.user.length,c),o.before.period),o}}),csstext:()=>"text-center px-0 font-weight-bold text-subtitle-1 cursor-help text-grey-darken-3",cssproc:()=>"text-center font-weight-bold text-subtitle-1 text-grey-darken-3 cursor-default"}}},lg=T("thead",null,[T("tr",null,[T("th",{class:"pr-0"}),T("th",{class:"text-center px-1"},"сегодня"),T("th",{class:"text-center"},"за период")])],-1),cg={class:"text-button"},dg=T("td",null,null,-1),ug={key:1},hg={key:2};function fg(i,t,e,n,s,o){const a=G("tooltip-ico"),r=G("tooltip-user"),l=G("pattern-card");return R(),H(l,{title:"Посещаемость портала",ico:"mdi-walk"},{filling:x(()=>[b(he,{class:"text-subtitle-2 table_traffic pt-1"},{default:x(()=>[lg,T("tbody",cg,[T("tr",null,[T("td",null,[b(a,{info:n.traffic.user},null,8,["info"])]),T("td",{class:qt(n.csstext())},[b(r,{info:n.traffic.user.today},null,8,["info"])],2),T("td",{class:qt(n.csstext())},[b(r,{info:n.traffic.user.period},null,8,["info"])],2)]),T("tr",null,[T("td",null,[b(a,{info:n.traffic.proc},null,8,["info"])]),T("td",{class:qt(n.cssproc())},W(n.traffic.proc.today)+"% ",3),T("td",{class:qt(n.cssproc())},W(n.traffic.proc.period)+"% ",3)]),T("tr",null,[T("td",null,[b(a,{info:n.traffic.before},null,8,["info"])]),dg,T("td",{class:qt(n.cssproc())},[parseFloat((n.traffic.user.period.length*100/n.traffic.before.period).toFixed(2))-100!="Infinity"&&parseFloat((n.traffic.user.period.length*100/n.traffic.before.period).toFixed(2))-100!=0?(R(),H(wt,{key:0,size:"x-small",class:qt(n.traffic.before.period{i.date_period.startdate=n},returnend:n=>{i.date_period.enddate=n},filterStore:i}}},mg={class:"px-2 pb-1"},bg={class:"px-2 pb-1"},_g={class:"text-caption font-weight-regular"};function yg(i,t,e,n,s,o){const a=G("date-select");return R(),H(el,{density:"compact",class:"text-h6 font-weight-regular"},{default:x(()=>[b(wt,{icon:"mdi-poll",color:"cyan-darken-3",class:"mx-2"}),Q(" Статистика портала за период с "),T("div",mg,[b(a,{onReturndate:n.returnstart,datedefault:n.filterStore.date_period.startdate},null,8,["onReturndate","datedefault"])]),Q(" по "),T("div",bg,[b(a,{onReturndate:n.returnend,datedefault:n.filterStore.date_period.enddate},null,8,["onReturndate","datedefault"])]),T("div",_g," ("+W(e.nStaff)+" активных учетных записей) ",1)]),_:1})}const xg=ut(pg,[["render",yg]]);const vg={components:{TooltipText:Io,PatternCard:qi},props:{pages_count:{type:Array,default:()=>[]}},setup(i){const t=J([{key:"now",order:"desc"}]),e=J("уникальные");let n=J([{title:"",align:"start",key:"name"},{title:"сегодня",align:"center",key:"now",value:f=>`${e.value=="уникальные"?f.now.unic.size:f.now.total}`},{title:"за период",align:"center",key:"period",value:f=>`${e.value=="уникальные"?f.period.unic.size:f.period.total}`}]);const s=()=>{let f=[];return i.pages_count.forEach(g=>{let m=f.findIndex(p=>p.name==g.pages);if(m==-1){let p={name:g.pages,now:{unic:new Set,total:0},period:{unic:new Set,total:0}};g.visitdate==Ot(new Date)&&(p.now.unic.add(Kt(g.user)),p.now.total=g.count),p.period.unic.add(Kt(g.user)),p.period.total=g.count,f.push(p)}else g.visitdate==Ot(new Date)&&(f[m].now.unic.add(Kt(g.user)),f[m].now.total+=g.count),f[m].period.unic.add(Kt(g.user)),f[m].period.total+=g.count}),f},o=J(!1),a=f=>f>10?"text-green":f>5?"text-orange":"text-red",r=f=>f>30?"text-green":f>15?"text-orange":"text-red",l=f=>f>50?"text-green":f>25?"text-orange":"text-red",c=f=>f>100?"text-green":f>50?"text-orange":"text-red",d=f=>f>10?"text-green":f>5?"text-orange":"text-red",u=()=>{let f=h.value;if(t.value!==void 0&&t.value.length>0){let g=t.value[0].order=="desc"?[-1,1]:[1,-1];e.value=="уникальные"?f.sort((m,p)=>m[t.value[0].key].unic.size>p[t.value[0].key].unic.size?g[0]:m[t.value[0].key].unic.sizem[t.value[0].key].total>p[t.value[0].key].total?g[0]:m[t.value[0].key].totali.pages_count,f=>{f!==[]&&(h.value=s(),u())}),{tabledata:h,sortBy:t,customSort:u,untot:e,modelrating:o,getColorTooday1:a,getColorPeriod1:r,getColorTooday2:l,getColorPeriod2:c,getColorNow:d,headers:n,datas:s}}},wg={class:"font-weight-medium cursor-default text-grey-darken-3 myleft text-subtitle-2"},kg={class:"font-weight-medium text-subtitle-2"},Sg={class:"font-weight-medium text-subtitle-2"};function Mg(i,t,e,n,s,o){const a=G("pattern-card");return R(),H(a,{title:"Рейтинг посещаемости страниц портала",ico:"mdi-chart-bar"},{filling:x(()=>[b(xa,{headers:n.headers,items:n.tabledata,height:"400",class:"mytable","item-value":"name","onUpdate:sortBy":[n.customSort,t[1]||(t[1]=r=>n.sortBy=r)],"sort-by":n.sortBy,density:"compact"},{"header.name":x(()=>[b(nl,{label:n.untot,"false-value":"уникальные","true-value":"всего","hide-details":"",modelValue:n.untot,"onUpdate:modelValue":t[0]||(t[0]=r=>n.untot=r),class:"myleft ml-n4"},null,8,["label","modelValue"])]),"item.name":x(({value:r})=>[T("span",wg,W(r),1)]),"item.now":x(({value:r,item:l})=>[T("span",kg,[r>0?(R(),H(Yt,{key:0,location:"bottom"},{activator:x(({props:c})=>[T("span",et(c,{class:[n.getColorTooday2(r),"cursor-help font-weight-medium text-subtitle-1"]}),W(r),17)]),default:x(()=>[b(U,{"no-gutters":""},{default:x(()=>[b(F,null,{default:x(()=>[(R(!0),ft(vt,null,ee(l.now.unic,c=>(R(),H(U,{"no-gutters":"",key:c},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(c),1)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024)):Qe("",!0)])]),"item.period":x(({value:r,item:l})=>[T("span",Sg,[r>0?(R(),H(Yt,{key:0,location:"bottom"},{activator:x(({props:c})=>[T("span",et(c,{class:[n.getColorPeriod2(r),"cursor-help font-weight-medium text-subtitle-1"]}),W(r),17)]),default:x(()=>[b(U,{"no-gutters":""},{default:x(()=>[b(F,null,{default:x(()=>[(R(!0),ft(vt,null,ee(l.period.unic,c=>(R(),H(U,{"no-gutters":"",key:c},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(c),1)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024)):Qe("",!0)])]),_:1},8,["headers","items","onUpdate:sortBy","sort-by"])]),_:1})}const Pg=ut(vg,[["render",Mg]]),Cg={components:{Feedmodul:fc,DateSelect:wa,TopUser:va,LineChart:tg,PortalTraffic:gg,ToolbarFilter:xg,RatingPage:Pg,CardTotal:Vo},setup(){const i=J({}),t=J({crr:{title:"Удержание",abb:"(CRR)",tooltip:"Customer retention rate - коэффициент удержания пользователей. Retention является одной из важнейших метрик продукта - он показывает, есть ли проблемы с вовлечением новых пользователей, и помогает спрогнозировать, будет ли проект успешным в перспективе",data:0},br:{title:"Отказы",abb:"(BR)",tooltip:"Bounce Rate - термин в веб-аналитике, обозначающий процентное соотношение количества посетителей, покинувших сайт прямо со страницы входа или просмотревших не более одной страницы сайта к общему количеству посетителей",data:0},ppv:{title:"Страниц за визит",abb:"(PPV)",tooltip:"Pages Per Visit - глубина просмотра страниц. Поведенческая метрика, которая показывает, сколько страниц на сайте в среднем просматривает пользователь",data:0}}),e=Gi(),n=J({period:[],staff:0,beforperiod:[],feedback:{criteria:[],feed:[],last_comment:{time_create:"1990-01-01"}}}),s=()=>{Ur.get(`api/watcher/dataforstatistics/?start=${Ot(e.date_period.startdate)}&end=${Ot(e.date_period.enddate)}`).then(c=>{n.value=o(c.data),a()})};s();const o=c=>{let d=[];return c.beforperiod.forEach(u=>{let h=d.findIndex(f=>f.visitdate===u.visitdate);h>-1?d[h].user.push(u.user__user_id):d.push({visitdate:u.visitdate,user:[u.user__user_id]})}),c.beforperiod=d,c},a=()=>{let c=new Set([]);n.value.beforperiod.forEach(g=>c.add(...g.user));let d=new Set([]),u={},h=n.value.period;Ot(e.date_period.enddate)!=Ot(new Date)&&(h=h.filter(g=>g.visitdate!=Ot(new Date))),h.forEach(g=>{d.add(g.user.id),u[g.visitdate]||(u[g.visitdate]={});let m=Kt(g.user);u[g.visitdate][m]||(u[g.visitdate][m]=[]),u[g.visitdate][m].push({page:g.fullPath,total:g.count})});let f={};for(let[g,m]of Object.entries(u)){f[g]={unic:Object.keys(m),count:0,br:0,pages:0};let p=Object.values(m);f[g].br=p.filter(_=>_.length==1).length,p.forEach(_=>f[g].pages+=_.length),p.flat().reduce((_,y)=>(f[g].count+=y.total,_),f[g].count)}l(f),i.value=f},r=c=>{t.value.crr.data=c},l=c=>{let d={brtot:0,ppvtot:0,unictot:0,pagetot:0};Object.values(c).flat().forEach(u=>{d.brtot+=u.br,d.ppvtot+=u.count,d.unictot+=u.unic.length,d.pagetot+=u.pages}),t.value.br.data=d.brtot/d.unictot*100,t.value.ppv.data=d.pagetot/d.unictot};return oi(()=>e.date_period,()=>{s()},{deep:!0}),Yr(),{alldata:n,cardtotal:t,dataLineChart:i,filterStore:e,getCRR:r,filter:J("d")}}};function Dg(i,t,e,n,s,o){const a=G("toolbar-filter"),r=G("portal-traffic"),l=G("card-total"),c=G("line-chart"),d=G("rating-page"),u=G("top-user"),h=G("feedmodul");return n.alldata.feedback.last_comment.time_create=="1990-01-01"?(R(),H(U,{key:0},{default:x(()=>[b(F,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[b(Xr,{size:150,width:7,color:"cyan-darken-3",indeterminate:""})]),_:1})]),_:1})):(R(),H(U,{key:1,"no-gutters":"",class:"gap ma-1 flex-column"},{default:x(()=>[b(F,{class:"d-flex flex-column w100 pa-0 flex-grow-0"},{default:x(()=>[b(a,{nStaff:n.alldata.staff},null,8,["nStaff"])]),_:1}),b(F,{class:"d-flex"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap"},{default:x(()=>[b(F,{lg:"2",class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap ma-0 flex-column"},{default:x(()=>[b(F,{lg:"4",class:"flex-column d-flex w100"},{default:x(()=>[b(r,{alldata:n.alldata},null,8,["alldata"])]),_:1}),b(F,{class:"flex-column d-flex w100"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[(R(!0),ft(vt,null,ee(n.cardtotal,f=>(R(),H(F,{key:f},{default:x(()=>[b(l,{indicator:f},null,8,["indicator"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1}),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{lg:"4",class:"w100"},{default:x(()=>[(R(),H(c,{key:`${n.filterStore.date_period.startdate}-${n.filterStore.date_period.enddate}`,dataLineChart:n.dataLineChart,period:{before:n.alldata.beforperiod,period:n.alldata.period},filter:n.filter,onGetCRR:n.getCRR},null,8,["dataLineChart","period","filter","onGetCRR"]))]),_:1}),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap"},{default:x(()=>[b(F,null,{default:x(()=>[b(d,{pages_count:n.alldata.period},null,8,["pages_count"])]),_:1}),b(F,null,{default:x(()=>[b(u,{activusers:n.alldata.period},null,8,["activusers"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),b(F,{lg:"2"},{default:x(()=>[b(h,{feedback:n.alldata.feedback},null,8,["feedback"])]),_:1})]),_:1})]),_:1})]),_:1}))}const Gg=ut(Cg,[["render",Dg]]);export{Gg as default}; + */const Jf={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Ua._date.override(typeof at=="function"?{_id:"moment",formats:function(){return Jf},parse:function(i,t){return typeof i=="string"&&typeof t=="string"?i=at(i,t):i instanceof at||(i=at(i)),i.isValid()?i.valueOf():null},format:function(i,t){return at(i).format(t)},add:function(i,t,e){return at(i).add(t,e).valueOf()},diff:function(i,t,e){return at(i).diff(at(t),e)},startOf:function(i,t,e){return i=at(i),t==="isoWeek"?(e=Math.trunc(Math.min(Math.max(0,e),6)),i.isoWeekday(e).startOf("day").valueOf()):i.startOf(t).valueOf()},endOf:function(i,t){return at(i).endOf(t).valueOf()}}:{});Zi.register(Kf,An,In,qe,Ne,nf,uf,tf,si);const Qf={components:{Line:Df},props:{dataLineChart:{type:Object,default:()=>{}},period:{type:Object,default:()=>{}},filter:{type:String,default:"d"}},setup(i,{emit:t}){const e=Gi(),n=J(0),s={datasets:[{label:"Открыто страниц",backgroundColor:"#C62828",borderColor:"#C62828",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>g.count,datakey:"count",tooltips:!1,hidden:!0,yAxisID:"y"},{label:"Активные пользователи",backgroundColor:"teal",borderColor:"teal",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>g.unic.length,datakey:"unic",customlabel:[],tooltips:!0,yAxisID:"y"},{label:"CRR",backgroundColor:"#673AB7",borderColor:"#673AB7",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:(g,m)=>parseFloat(l(m).toFixed(2)),hidden:!0,datakey:"crr",customlabel:[],tooltips:!0,yAxisID:"y1"},{label:"BR",backgroundColor:"#283593",borderColor:"#283593",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>parseFloat((g.br/g.unic.length*100).toFixed(2)),datakey:"br",hidden:!0,customlabel:[],tooltips:!0,yAxisID:"y1"},{label:"PPV",backgroundColor:"#EF9A9A",borderColor:"#EF9A9A",borderWidth:3,cubicInterpolationMode:"monotone",data:[],func:g=>parseFloat((g.pages/g.unic.length).toFixed(2)),datakey:"ppv",hidden:!0,customlabel:[],tooltips:!0,yAxisID:"y"}]},o=z({get(){r();let g=at(e.date_period.enddate),m=at(e.date_period.startdate);n.value=g.diff(m,"days")+1;let p=null;if(Object.keys(i.dataLineChart).length>0){p=s,p.labels=[],p.datasets.forEach(_=>{_.data=[]});for(let[_,y]of Object.entries(i.dataLineChart))p.datasets.forEach(w=>{w.data.push(w.func(y,_))}),p.labels.push(Ro(_))}return p}}),a=J([]),r=()=>{let g=[];i.period.period.forEach(m=>{let p=g.findIndex(_=>_.visitdate==m.visitdate);p==-1?g.push({visitdate:m.visitdate,user:Array.from(new Set([m.user.id]))}):g[p].user=Array.from(new Set(g[p].user).add(m.user.id))}),a.value=[...i.period.before,...g]},l=g=>{let m=d(a.value.filter(y=>new Date(y.visitdate)>at(new Date(g)).subtract(n.value*2,"d")&&new Date(y.visitdate)<=at(new Date(g)).subtract(n.value,"d"))),p=d(a.value.filter(y=>new Date(y.visitdate)>at(new Date(g)).subtract(n.value,"d")&&new Date(y.visitdate)<=new Date(g))),_=new Set([...m].filter(y=>p.has(y)));return g==Ot(e.date_period.enddate)&&c(_.size*100/m.size),m.size==0?0:_.size*100/m.size},c=g=>{t("getCRR",g)},d=g=>{let m=[];return g.forEach(p=>m.push(...p.user)),new Set(m)},u=z({get(){return JSON.parse(JSON.stringify(o.value))}}),h=J(null);return{data:u,options:{plugins:{datalabels:{color:"grey",align:"top",display:"auto"},legend:{onHover:(g,m)=>{g.native.target.style.cursor="pointer"},onLeave:(g,m)=>{g.native.target.style.cursor="default"},position:"bottom",labels:{color:"grey",align:"right"}}},layout:{padding:{top:35,bottom:5,left:20,right:15}},scales:{x:{grid:{color:"white"}},y:{ticks:{stepSize:10},offset:!0,grid:{color:"white"}},y1:{type:"linear",display:!0,position:"right"}},responsive:!0,maintainAspectRatio:!1},linear:h}}};function Zf(i,t,e,n,s,o){const a=G("Line");return R(),H(ge,{class:"h-100"},{default:x(()=>[n.data!==null?(R(),H(a,{key:0,data:n.data,ref:"linear",options:n.options},null,8,["data","options"])):Qe("",!0)]),_:1})}const tg=ut(Qf,[["render",Zf]]),eg={props:{info:{type:Object,default:()=>({tooltip:"",ico:"",color:""})}},setup(i){return{}}};function ig(i,t,e,n,s,o){return R(),H(Yt,{location:"top"},{activator:x(({props:a})=>[T("span",Ri(Fi(a)),[b(wt,{class:"cursor-help",size:"large",color:e.info.color,icon:e.info.ico},null,8,["color","icon"])],16)]),default:x(()=>[b(U,null,{default:x(()=>[b(F,null,{default:x(()=>[Q(W(e.info.tooltip),1)]),_:1})]),_:1})]),_:1})}const ng=ut(eg,[["render",ig]]),sg={props:{info:{type:Array,default:()=>[]}}};function og(i,t,e,n,s,o){return R(),H(Yt,{location:"top"},{activator:x(({props:a})=>[T("span",Ri(Fi(a)),W(e.info.length),17)]),default:x(()=>[(R(!0),ft(vt,null,ee(e.info,a=>(R(),H(U,{"no-gutters":"",key:a},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(a),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})}const ag=ut(sg,[["render",og]]);const rg={components:{PatternCard:qi,TooltipIco:ng,TooltipUser:ag},props:{alldata:{type:Object,default:()=>({period:[],staff:0})}},setup(i){const t=Gi();return{traffic:z({get(){let o={user:{tooltip:"Уникальные пользователи",today:[],period:[],ico:"mdi-account-box",color:"indigo"},proc:{tooltip:"% от штата",today:0,period:0,ico:"mdi-chart-pie",color:"green"},before:{tooltip:"По сравнению предыдущим периодом",today:"",period:0,ico:"mdi-elevation-rise",color:"pink-darken-4"}};i.alldata.period.forEach(c=>{c.visitdate==Ot(new Date)&&os(o.user.today,Kt(c.user)),new Date(c.visitdate)<=t.date_period.enddate&&os(o.user.period,Kt(c.user))}),o.proc.today=parseFloat((o.user.today.length*100/i.alldata.staff).toFixed(2)),o.proc.period=parseFloat((o.user.period.length*100/i.alldata.staff).toFixed(2));let a=at(t.date_period.enddate),r=at(t.date_period.startdate),l=a.diff(r,"days")+1;return i.alldata.beforperiod.filter(c=>r.diff(at(c.visitdate),"days")(o.before.period+=d.user.length,c),o.before.period),o}}),csstext:()=>"text-center px-0 font-weight-bold text-subtitle-1 cursor-help text-grey-darken-3",cssproc:()=>"text-center font-weight-bold text-subtitle-1 text-grey-darken-3 cursor-default"}}},lg=T("thead",null,[T("tr",null,[T("th",{class:"pr-0"}),T("th",{class:"text-center px-1"},"сегодня"),T("th",{class:"text-center"},"за период")])],-1),cg={class:"text-button"},dg=T("td",null,null,-1),ug={key:1},hg={key:2};function fg(i,t,e,n,s,o){const a=G("tooltip-ico"),r=G("tooltip-user"),l=G("pattern-card");return R(),H(l,{title:"Посещаемость портала",ico:"mdi-walk"},{filling:x(()=>[b(he,{class:"text-subtitle-2 table_traffic pt-1"},{default:x(()=>[lg,T("tbody",cg,[T("tr",null,[T("td",null,[b(a,{info:n.traffic.user},null,8,["info"])]),T("td",{class:qt(n.csstext())},[b(r,{info:n.traffic.user.today},null,8,["info"])],2),T("td",{class:qt(n.csstext())},[b(r,{info:n.traffic.user.period},null,8,["info"])],2)]),T("tr",null,[T("td",null,[b(a,{info:n.traffic.proc},null,8,["info"])]),T("td",{class:qt(n.cssproc())},W(n.traffic.proc.today)+"% ",3),T("td",{class:qt(n.cssproc())},W(n.traffic.proc.period)+"% ",3)]),T("tr",null,[T("td",null,[b(a,{info:n.traffic.before},null,8,["info"])]),dg,T("td",{class:qt(n.cssproc())},[parseFloat((n.traffic.user.period.length*100/n.traffic.before.period).toFixed(2))-100!="Infinity"&&parseFloat((n.traffic.user.period.length*100/n.traffic.before.period).toFixed(2))-100!=0?(R(),H(wt,{key:0,size:"x-small",class:qt(n.traffic.before.period{i.date_period.startdate=n},returnend:n=>{i.date_period.enddate=n},filterStore:i}}},mg={class:"px-2 pb-1"},bg={class:"px-2 pb-1"},_g={class:"text-caption font-weight-regular"};function yg(i,t,e,n,s,o){const a=G("date-select");return R(),H(il,{density:"compact",class:"text-h6 font-weight-regular"},{default:x(()=>[b(wt,{icon:"mdi-poll",color:"cyan-darken-3",class:"mx-2"}),Q(" Статистика портала за период с "),T("div",mg,[b(a,{onReturndate:n.returnstart,datedefault:n.filterStore.date_period.startdate},null,8,["onReturndate","datedefault"])]),Q(" по "),T("div",bg,[b(a,{onReturndate:n.returnend,datedefault:n.filterStore.date_period.enddate},null,8,["onReturndate","datedefault"])]),T("div",_g," ("+W(e.nStaff)+" активных учетных записей) ",1)]),_:1})}const xg=ut(pg,[["render",yg]]);const vg={components:{TooltipText:Io,PatternCard:qi},props:{pages_count:{type:Array,default:()=>[]}},setup(i){const t=J([{key:"now",order:"desc"}]),e=J("уникальные");let n=J([{title:"",align:"start",key:"name"},{title:"сегодня",align:"center",key:"now",value:f=>`${e.value=="уникальные"?f.now.unic.size:f.now.total}`},{title:"за период",align:"center",key:"period",value:f=>`${e.value=="уникальные"?f.period.unic.size:f.period.total}`}]);const s=()=>{let f=[];return i.pages_count.forEach(g=>{let m=f.findIndex(p=>p.name==g.pages);if(m==-1){let p={name:g.pages,now:{unic:new Set,total:0},period:{unic:new Set,total:0}};g.visitdate==Ot(new Date)&&(p.now.unic.add(Kt(g.user)),p.now.total=g.count),p.period.unic.add(Kt(g.user)),p.period.total=g.count,f.push(p)}else g.visitdate==Ot(new Date)&&(f[m].now.unic.add(Kt(g.user)),f[m].now.total+=g.count),f[m].period.unic.add(Kt(g.user)),f[m].period.total+=g.count}),f},o=J(!1),a=f=>f>10?"text-green":f>5?"text-orange":"text-red",r=f=>f>30?"text-green":f>15?"text-orange":"text-red",l=f=>f>50?"text-green":f>25?"text-orange":"text-red",c=f=>f>100?"text-green":f>50?"text-orange":"text-red",d=f=>f>10?"text-green":f>5?"text-orange":"text-red",u=()=>{let f=h.value;if(t.value!==void 0&&t.value.length>0){let g=t.value[0].order=="desc"?[-1,1]:[1,-1];e.value=="уникальные"?f.sort((m,p)=>m[t.value[0].key].unic.size>p[t.value[0].key].unic.size?g[0]:m[t.value[0].key].unic.sizem[t.value[0].key].total>p[t.value[0].key].total?g[0]:m[t.value[0].key].totali.pages_count,f=>{f!==[]&&(h.value=s(),u())}),{tabledata:h,sortBy:t,customSort:u,untot:e,modelrating:o,getColorTooday1:a,getColorPeriod1:r,getColorTooday2:l,getColorPeriod2:c,getColorNow:d,headers:n,datas:s}}},wg={class:"font-weight-medium cursor-default text-grey-darken-3 myleft text-subtitle-2"},kg={class:"font-weight-medium text-subtitle-2"},Sg={class:"font-weight-medium text-subtitle-2"};function Mg(i,t,e,n,s,o){const a=G("pattern-card");return R(),H(a,{title:"Рейтинг посещаемости страниц портала",ico:"mdi-chart-bar"},{filling:x(()=>[b(xa,{headers:n.headers,items:n.tabledata,height:"400",class:"mytable","item-value":"name","onUpdate:sortBy":[n.customSort,t[1]||(t[1]=r=>n.sortBy=r)],"sort-by":n.sortBy,density:"compact"},{"header.name":x(()=>[b(nl,{label:n.untot,"false-value":"уникальные","true-value":"всего","hide-details":"",modelValue:n.untot,"onUpdate:modelValue":t[0]||(t[0]=r=>n.untot=r),class:"myleft ml-n4"},null,8,["label","modelValue"])]),"item.name":x(({value:r})=>[T("span",wg,W(r),1)]),"item.now":x(({value:r,item:l})=>[T("span",kg,[r>0?(R(),H(Yt,{key:0,location:"bottom"},{activator:x(({props:c})=>[T("span",et(c,{class:[n.getColorTooday2(r),"cursor-help font-weight-medium text-subtitle-1"]}),W(r),17)]),default:x(()=>[b(U,{"no-gutters":""},{default:x(()=>[b(F,null,{default:x(()=>[(R(!0),ft(vt,null,ee(l.now.unic,c=>(R(),H(U,{"no-gutters":"",key:c},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(c),1)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024)):Qe("",!0)])]),"item.period":x(({value:r,item:l})=>[T("span",Sg,[r>0?(R(),H(Yt,{key:0,location:"bottom"},{activator:x(({props:c})=>[T("span",et(c,{class:[n.getColorPeriod2(r),"cursor-help font-weight-medium text-subtitle-1"]}),W(r),17)]),default:x(()=>[b(U,{"no-gutters":""},{default:x(()=>[b(F,null,{default:x(()=>[(R(!0),ft(vt,null,ee(l.period.unic,c=>(R(),H(U,{"no-gutters":"",key:c},{default:x(()=>[b(F,null,{default:x(()=>[Q(W(c),1)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:2},1024)):Qe("",!0)])]),_:1},8,["headers","items","onUpdate:sortBy","sort-by"])]),_:1})}const Pg=ut(vg,[["render",Mg]]),Cg={components:{Feedmodul:fc,DateSelect:wa,TopUser:va,LineChart:tg,PortalTraffic:gg,ToolbarFilter:xg,RatingPage:Pg,CardTotal:Vo},setup(){const i=J({}),t=J({crr:{title:"Удержание",abb:"(CRR)",tooltip:"Customer retention rate - коэффициент удержания пользователей. Retention является одной из важнейших метрик продукта - он показывает, есть ли проблемы с вовлечением новых пользователей, и помогает спрогнозировать, будет ли проект успешным в перспективе",data:0},br:{title:"Отказы",abb:"(BR)",tooltip:"Bounce Rate - термин в веб-аналитике, обозначающий процентное соотношение количества посетителей, покинувших сайт прямо со страницы входа или просмотревших не более одной страницы сайта к общему количеству посетителей",data:0},ppv:{title:"Страниц за визит",abb:"(PPV)",tooltip:"Pages Per Visit - глубина просмотра страниц. Поведенческая метрика, которая показывает, сколько страниц на сайте в среднем просматривает пользователь",data:0}}),e=Gi(),n=J({period:[],staff:0,beforperiod:[],feedback:{criteria:[],feed:[],last_comment:{time_create:"1990-01-01"}}}),s=()=>{Ur.get(`api/watcher/dataforstatistics/?start=${Ot(e.date_period.startdate)}&end=${Ot(e.date_period.enddate)}`).then(c=>{n.value=o(c.data),a()})};s();const o=c=>{let d=[];return c.beforperiod.forEach(u=>{let h=d.findIndex(f=>f.visitdate===u.visitdate);h>-1?d[h].user.push(u.user__user_id):d.push({visitdate:u.visitdate,user:[u.user__user_id]})}),c.beforperiod=d,c},a=()=>{let c=new Set([]);n.value.beforperiod.forEach(g=>c.add(...g.user));let d=new Set([]),u={},h=n.value.period;Ot(e.date_period.enddate)!=Ot(new Date)&&(h=h.filter(g=>g.visitdate!=Ot(new Date))),h.forEach(g=>{d.add(g.user.id),u[g.visitdate]||(u[g.visitdate]={});let m=Kt(g.user);u[g.visitdate][m]||(u[g.visitdate][m]=[]),u[g.visitdate][m].push({page:g.fullPath,total:g.count})});let f={};for(let[g,m]of Object.entries(u)){f[g]={unic:Object.keys(m),count:0,br:0,pages:0};let p=Object.values(m);f[g].br=p.filter(_=>_.length==1).length,p.forEach(_=>f[g].pages+=_.length),p.flat().reduce((_,y)=>(f[g].count+=y.total,_),f[g].count)}l(f),i.value=f},r=c=>{t.value.crr.data=c},l=c=>{let d={brtot:0,ppvtot:0,unictot:0,pagetot:0};Object.values(c).flat().forEach(u=>{d.brtot+=u.br,d.ppvtot+=u.count,d.unictot+=u.unic.length,d.pagetot+=u.pages}),t.value.br.data=d.brtot/d.unictot*100,t.value.ppv.data=d.pagetot/d.unictot};return oi(()=>e.date_period,()=>{s()},{deep:!0}),Yr(),{alldata:n,cardtotal:t,dataLineChart:i,filterStore:e,getCRR:r,filter:J("d")}}};function Dg(i,t,e,n,s,o){const a=G("toolbar-filter"),r=G("portal-traffic"),l=G("card-total"),c=G("line-chart"),d=G("rating-page"),u=G("top-user"),h=G("feedmodul");return n.alldata.feedback.last_comment.time_create=="1990-01-01"?(R(),H(U,{key:0},{default:x(()=>[b(F,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:x(()=>[b(Xr,{size:150,width:7,color:"cyan-darken-3",indeterminate:""})]),_:1})]),_:1})):(R(),H(U,{key:1,"no-gutters":"",class:"gap ma-1 flex-column"},{default:x(()=>[b(F,{class:"d-flex flex-column w100 pa-0 flex-grow-0"},{default:x(()=>[b(a,{nStaff:n.alldata.staff},null,8,["nStaff"])]),_:1}),b(F,{class:"d-flex"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap"},{default:x(()=>[b(F,{lg:"2",class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap ma-0 flex-column"},{default:x(()=>[b(F,{lg:"4",class:"flex-column d-flex w100"},{default:x(()=>[b(r,{alldata:n.alldata},null,8,["alldata"])]),_:1}),b(F,{class:"flex-column d-flex w100"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[(R(!0),ft(vt,null,ee(n.cardtotal,f=>(R(),H(F,{key:f},{default:x(()=>[b(l,{indicator:f},null,8,["indicator"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1}),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"flex-column gap"},{default:x(()=>[b(F,{lg:"4",class:"w100"},{default:x(()=>[(R(),H(c,{key:`${n.filterStore.date_period.startdate}-${n.filterStore.date_period.enddate}`,dataLineChart:n.dataLineChart,period:{before:n.alldata.beforperiod,period:n.alldata.period},filter:n.filter,onGetCRR:n.getCRR},null,8,["dataLineChart","period","filter","onGetCRR"]))]),_:1}),b(F,{class:"d-flex flex-column"},{default:x(()=>[b(U,{"no-gutters":"",class:"gap"},{default:x(()=>[b(F,null,{default:x(()=>[b(d,{pages_count:n.alldata.period},null,8,["pages_count"])]),_:1}),b(F,null,{default:x(()=>[b(u,{activusers:n.alldata.period},null,8,["activusers"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),b(F,{lg:"2"},{default:x(()=>[b(h,{feedback:n.alldata.feedback},null,8,["feedback"])]),_:1})]),_:1})]),_:1})]),_:1}))}const Kg=ut(Cg,[["render",Dg]]);export{Kg as default}; diff --git a/src/front/dist/assets/BigCalendar-e753427e.js b/src/front/dist/assets/BigCalendar-e8fd5b6e.js similarity index 55% rename from src/front/dist/assets/BigCalendar-e753427e.js rename to src/front/dist/assets/BigCalendar-e8fd5b6e.js index 85a64230a..cb03aa0c1 100644 --- a/src/front/dist/assets/BigCalendar-e753427e.js +++ b/src/front/dist/assets/BigCalendar-e8fd5b6e.js @@ -1,7 +1,7 @@ -import{d as qt,r as O,U as ue,_ as ae,s as L,t as z,v as f,x as u,B as Kt,y as W,$ as Z,V as Se,cG as te,C as Bt,c3 as Gt,F as Zt,A as ne,a0 as De,K as xt,l as Ie,f as H,dv as Jt,cS as et,M as ce,a3 as ke,Z as Xt,z as Ee,R as fe,S as be,T as Re,dw as je,a2 as Tt,Q as G,cR as lt,aP as Le,E as k,d2 as Qt,D as P,Y as St,W as Be,a4 as $t,L as Ct,aL as en,G as tn,H as nn,q as an,w as rn}from"./index-84cc8e63.js";import{V as on}from"./VForm-22e5b970.js";import{V as Me}from"./VCheckboxBtn-c07777d8.js";import{a as ln}from"./VList-d0850642.js";import{V as Ne}from"./VAutocomplete-4b4c3aba.js";import{V as xe}from"./VTextarea-08b60249.js";import{V as tt,a as Ot}from"./VLocaleProvider-396cfd34.js";import{V as sn}from"./VFileInput-ac5ef80a.js";import{V as Ut}from"./VTextField-4eb073db.js";import{b as dn,c as un,a as cn,V as fn}from"./VExpansionPanels-50a2ee63.js";import"./VInput-e5a7e0e7.js";import"./VSelectionControl-b8db7e28.js";import"./ssrBoot-04c9ae84.js";import"./VSelect-db8f1e56.js";import"./VVirtualScroll-9b239331.js";/* empty css */import"./VField-e3c852c7.js";import"./VSpacer-bea6911b.js";const yn=qt("weekends",()=>{const n=O({});function e(a){ue.get(`api/calendar_of_events/exclusion_dates/?year=${a}`,{}).then(t=>{n.value=t.data})}return{week:n,getWeekend:e}}),hn={props:{title:{type:String,default:""},newOrOld:{type:Boolean,default:!1}},setup(n,{emit:e}){const a=O(null);return{form_valid:a,transformation:()=>{e("postData",a.value.isValid)},clearFormValidation:()=>{a.value&&a.value.resetValidation()}}}};function vn(n,e,a,t,r,l){return L(),z(xt,{"min-height":"436",class:"pa-3"},{default:f(()=>[u(Kt,{class:"pr-0 pl-2 d-flex justify-space-between"},{default:f(()=>[W(Z(a.title)+" ",1),u(Se,{icon:"mdi-close cursor-pointer",size:"small",color:"grey",onClick:e[0]||(e[0]=s=>n.$emit("closeDialog"))})]),_:1}),u(on,{ref:"form_valid",onSubmit:te(t.transformation,["prevent"])},{default:f(()=>[u(Bt,{class:"d-flex px-3"},{default:f(()=>[Gt(n.$slots,"card_text")]),_:3}),u(Zt,{class:"justify-end"},{default:f(()=>[a.newOrOld?De("",!0):(L(),z(ne,{key:0,icon:"mdi-delete",variant:"tonal",rounded:"",size:"36px",onClick:e[1]||(e[1]=s=>n.$emit("delObject"))})),u(ne,{class:"text-subtitle-1",elevation:"0",width:"150",onClick:e[2]||(e[2]=s=>n.$emit("closeDialog")),color:"btn_gray",variant:"flat"},{default:f(()=>[W("Отменить")]),_:1}),u(ne,{class:"text-subtitle-1 font-weight-regular",color:"btn_text",variant:"flat",elevation:"0",width:"150",type:"transformation"},{default:f(()=>[W(Z(a.newOrOld?"Создать":"Редактировать"),1)]),_:1})]),_:1})]),_:3},8,["onSubmit"])]),_:3})}const Mt=ae(hn,[["render",vn]]);const mn={props:{staff:{type:Array,default:()=>[]},okey:{type:String,default:"selected"}},setup(n,{emit:e}){const a=O(""),t=Ie(),r=O([]),l=H({get(){if(n.okey=="editor"){let d=[];return n.staff.forEach(y=>{let p={...y};p.employees=y.employees.filter(T=>T.selected==!0),p.employees.length>0&&d.push(p)}),d.forEach(y=>{y.employees.every(p=>p.editor==!0)&&(y.editor=!0)}),d}return n.staff}}),s=H({get(){let d=[];return n.staff.forEach(y=>{y.employees.length!=1&&y.employees.every(p=>p[n.okey]==!0)?(y[n.okey]=!0,d.push(y)):y.employees.length==1?(y[n.okey]=!0,d.push(...y.employees.filter(p=>p[n.okey]==!0))):(y[n.okey]=!1,d.push(...y.employees.filter(p=>p[n.okey]==!0)))}),d},set(d){Array.isArray(d)||i(d)}}),i=d=>{if("employees"in d)d.employees.forEach(y=>{y.id!=t.user.is_idEmployee&&(y[n.okey]=!d[n.okey])}),e("returnIdParticant",{okey:n.okey,staff:d.employees,select:[]});else if(d.length){if(d[0].id!=t.user.is_idEmployee){let y=!d.every(p=>p[n.okey]==!0);o(d,y),e("returnIdParticant",{okey:n.okey,staff:r.value,select:[]}),r.value=[]}}else d[n.okey]=!d[n.okey],e("returnIdParticant",{okey:n.okey,staff:[d],select:[]})},o=(d,y)=>{d.forEach(p=>{p.id!=t.user.is_idEmployee&&(p[n.okey]=y),"employees"in p||r.value.push(p),"employees"in p&&o(p.employees,y)})};function c(d,y){return d.includes(a.value)||y.raw.employees.some(p=>p.title.toLowerCase().includes(a.value.toLowerCase()))}return{staffed:l,filtered:a,accountStore:t,selectedStaff:s,splitname:Jt,onFilter:c,disable:d=>d.id==t.user.id_dict_department&&d.employees.length==1,allUser:()=>{i(l.value)}}}},pn=ce("span",{class:"text-body-2"}," ВСЕ СОТРУДНИКИ ",-1),bn={class:"text-body-2"};function wn(n,e,a,t,r,l){return L(),z(Ne,{modelValue:t.selectedStaff,"onUpdate:modelValue":e[2]||(e[2]=s=>t.selectedStaff=s),items:t.staffed,label:"Выберите из списка или найдите по ФИО","item-title":"title","item-value":"id","custom-filter":t.onFilter,"onUpdate:search":e[3]||(e[3]=s=>t.filtered=s),multiple:"","hide-details":"",variant:"outlined",density:"compact",class:"max-height-select py-3","return-object":""},{selection:f(({item:s})=>[u(et,{class:"me-2",color:"teal-darken-3",size:"small",label:""},{default:f(()=>[ce("span",null,Z(s.title),1),s.value!=t.accountStore.user.is_idEmployee?(L(),z(Se,{key:0,icon:"mdi-close-circle",size:"x-small",class:"ml-3",onClick:te(i=>t.selectedStaff=s.raw,["stop"])},null,8,["onClick"])):De("",!0)]),_:2},1024)]),"prepend-item":f(()=>[u(ke,{onClick:e[0]||(e[0]=te(s=>t.allUser(),["stop"])),disabled:t.staffed.length==1&&t.staffed[0].employees.length==1,class:"text-body-2"},{prepend:f(()=>[u(Me,{"model-value":t.staffed.every(s=>s[a.okey]==!0),disabled:t.staffed.length==1&&t.staffed[0].employees.length==1},null,8,["model-value","disabled"])]),default:f(()=>[pn]),_:1},8,["disabled"]),u(Xt,{class:"mt-2"})]),item:f(({props:s,item:i})=>[u(ln,Ee(s,{value:i.raw.title}),{activator:f(({props:o})=>[u(ke,Ee(o,{onClick:e[1]||(e[1]=te(()=>{},["stop"])),density:"compact",class:"text-body-2"}),{prepend:f(()=>[u(Me,{onClick:te(c=>t.selectedStaff=i.raw,["stop"]),color:"indigo-darken-4","true-value":!0,"false-value":!1,disabled:t.disable(i.raw),indeterminate:i.raw.employees.some(c=>c[a.okey]==!0)&&!i.raw.employees.every(c=>c[a.okey]==!0),"model-value":i.raw[a.okey]},null,8,["onClick","disabled","indeterminate","model-value"])]),_:2},1040)]),default:f(()=>[(L(!0),fe(be,null,Re(i.raw.employees.filter(o=>o.title.toLowerCase().includes(t.filtered.toLowerCase())),o=>(L(),z(ke,{key:o.id,value:o.title,disabled:o.id==t.accountStore.user.is_idEmployee,onClick:te(c=>t.selectedStaff=o,["stop"]),density:"compact"},{prepend:f(()=>[u(Me,{disabled:o.id==t.accountStore.user.is_idEmployee,color:"indigo-darken-4","model-value":o[a.okey]},null,8,["disabled","model-value"])]),default:f(()=>[ce("span",bn,Z(o.title),1)]),_:2},1032,["value","disabled","onClick"]))),128))]),_:2},1040,["value"])]),_:1},8,["modelValue","items","custom-filter"])}const Yt=ae(mn,[["render",wn]]),gn={props:{dateEvent:{type:String,default:""},limitation:{type:String,default:""},order:{type:Array,default:[0,0]},chek:{type:Boolean,default:!1},rule:{type:Number,default:-1}},setup(n,{emit:e}){const a=O(!1),t=O(!1),r=H({get:()=>new Date(n.dateEvent),set:h=>e("update:dateEvent",h)}),l=H({get(){return r.value},set(h){i(h,s.value)}}),s=H({get(){return`${new Date(r.value).getHours()}:${String(new Date(r.value).getMinutes()).padStart(2,"0")}`},set(h){i(l.value,h)}}),i=(h,d)=>{let y=d.split(":");d=y[0].padStart(2,"0")+":"+y[1],n.order[0]==4?d=="0:00"?r.value=h:new Date(je(h)+"T"+d)>=new Date(n.limitation)?r.value=new Date(je(h)+"T"+d):r.value=new Date(n.limitation):r.value=d=="0:00"?h:new Date(je(h)+"T"+d)};return{propsDateEvent:r,menudate:a,menutime:t,modelDate:l,formatComa:Tt,timeEvent:s,minData:()=>{let d=`${new Date(n.limitation).getHours()}:${String(new Date(n.limitation).getMinutes()).padStart(2,"0")}`=="0:00"?new Date(n.limitation):new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()-1));return new Date(d)},startMin:()=>n.rule==2?new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()-7)):!1,endMax:()=>n.rule==2?new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()+6)):!1}}};function _n(n,e,a,t,r,l){const s=G("v-time-picker");return L(),fe(be,null,[u(k,{lg:"3",class:Le(`order-${a.order[0]}`)},{default:f(()=>[u(lt,{modelValue:t.menudate,"onUpdate:modelValue":e[2]||(e[2]=i=>t.menudate=i),"close-on-content-click":!1,"nudge-right":40,transition:"scale-transition","offset-y":""},{activator:f(({props:i})=>[u(xe,Ee({modelValue:t.modelDate,"onUpdate:modelValue":e[0]||(e[0]=o=>t.modelDate=o),value:t.formatComa(t.modelDate),density:"compact","no-resize":"","row-height":"25",rows:"1",variant:"outlined"},i,{readonly:"","hide-details":""}),{"prepend-inner":f(()=>[u(Se,Ee(i,{icon:"mdi-calendar-today",color:"cyan-darken-3",size:"x-small"}),null,16)]),_:2},1040,["modelValue","value"])]),default:f(()=>[u(tt,{locale:"ru"},{default:f(()=>[u(Ot,{modelValue:t.modelDate,"onUpdate:modelValue":e[1]||(e[1]=i=>t.modelDate=i),"show-adjacent-months":"","hide-header":"",border:"","no-time":"",max:a.order[0]==2?new Date(a.limitation):t.endMax(),min:a.order[0]==2?t.startMin():t.minData()},null,8,["modelValue","max","min"])]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["class"]),u(k,{class:Le(["flex-grow-0",`order-${a.order[1]}`])},{default:f(()=>[u(xe,{density:"compact","no-resize":"","row-height":"25",width:"75",rows:"1",readonly:"",variant:"outlined",modelValue:t.timeEvent,"onUpdate:modelValue":e[3]||(e[3]=i=>t.timeEvent=i),active:t.menutime,focus:t.menutime,"hide-details":"",disabled:a.chek},null,8,["modelValue","active","focus","disabled"]),u(lt,{modelValue:t.menutime,"onUpdate:modelValue":e[5]||(e[5]=i=>t.menutime=i),"close-on-content-click":!1,activator:"parent",transition:"scale-transition"},{default:f(()=>[t.menutime?(L(),z(s,{key:0,modelValue:t.timeEvent,"onUpdate:modelValue":e[4]||(e[4]=i=>t.timeEvent=i),"full-width":"",format:"24hr"},null,8,["modelValue"])):De("",!0)]),_:1},8,["modelValue"])]),_:1},8,["class"])],64)}const kn=ae(gn,[["render",_n]]),Dn={props:{files:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=H({get:()=>n.files,set:s=>e("update:files",s)}),t=O([]),r=H({get(){return a.value.forEach(s=>{t.value.push(l("data:text/plain;base64,aGVsbG8gd29ybGQ=",Qt(decodeURI(s.file))))}),t.value},set(s){let i=[];t.value=[],s.length==0?(t.value=[],a.value=[]):s.forEach(o=>{t.value.push(o),i.push(o)}),e("postFiles",i)}});function l(s,i){for(var o=s.split(","),c=o[0].match(/:(.*?);/)[1],v=atob(o[1]),h=v.length,d=new Uint8Array(h);h--;)d[h]=v.charCodeAt(h);return new File([d],i,{type:c})}return{eventFiles:r,arrFiles:t}}},En={key:1,class:"text-overline text-grey-darken-3 mx-2"};function xn(n,e,a,t,r,l){return L(),z(k,null,{default:f(()=>[u(sn,{label:"Файлы",chips:"",multiple:"",modelValue:t.eventFiles,"onUpdate:modelValue":e[0]||(e[0]=s=>t.eventFiles=s),density:"compact",variant:"outlined",onClick:e[1]||(e[1]=te(()=>{},["stop"]))},{selection:f(({fileNames:s})=>[(L(!0),fe(be,null,Re(s,(i,o)=>(L(),fe(be,{key:i},[o<4?(L(),z(et,{key:0,class:"me-2",color:"teal-darken-3",size:"small",label:""},{default:f(()=>[W(Z(i),1)]),_:2},1024)):o===4?(L(),fe("span",En," +"+Z(a.files.length-4)+" файла(ов) ",1)):De("",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1})}const Tn=ae(Dn,[["render",xn]]),Sn={setup(){return{values:["браузером"],items:["браузером","bar","fizz","buzz"],valuesTime:["минут"],itemsTime:["часов","минут","fizz","buzz"]}}};function Cn(n,e,a,t,r,l){return L(),z(k,{class:"flex-column d-flex"},{default:f(()=>[u(P,{"no-gutters":"",class:"map"},{default:f(()=>[u(k,{lg:"4"},{default:f(()=>[u(Ne,{modelValue:t.values,"onUpdate:modelValue":e[0]||(e[0]=s=>t.values=s),variant:"outlined",items:t.items,density:"compact",disabled:"","hide-details":""},null,8,["modelValue","items"])]),_:1}),u(k,{class:"flex-grow-0 px-2 pt-2"},{default:f(()=>[W("за")]),_:1}),u(k,{class:"flex-grow-0 pr-2"},{default:f(()=>[u(Ut,{disabled:"","min-width":"55",density:"compact",variant:"outlined","hide-details":""},{default:f(()=>[W("10")]),_:1})]),_:1}),u(k,{lg:"3"},{default:f(()=>[u(Ne,{modelValue:t.valuesTime,"onUpdate:modelValue":e[1]||(e[1]=s=>t.valuesTime=s),variant:"outlined",items:t.itemsTime,density:"compact",disabled:"","hide-details":""},null,8,["modelValue","items"])]),_:1}),u(k,{class:"flex-grow-0 pt-3 pl-3"},{default:f(()=>[u(Se,{icon:"mdi-close cursor-pointer",size:"small",color:"grey",disabled:""})]),_:1})]),_:1})]),_:1})}const On=ae(Sn,[["render",Cn]]),Un={props:{dateEventStart:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=H({get(){return t.value.allday},set(r){t.value.allday=r,r==!0&&(t.value.date_end=new Date(new Date(t.value.date_end).setHours(23,59,0)))&&(t.value.date_start=new Date(new Date(t.value.date_start).setHours(0,0,0)))}}),t=H({get:()=>n.dateEventStart,set:r=>e("update:dateEventStart",r)});return{newDate:a}}};function Mn(n,e,a,t,r,l){return L(),z(k,{class:"pb-2 pt-2 d-flex flex-column ml-n3",lg:"3"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(k,null,{default:f(()=>[u(Me,{modelValue:t.newDate,"onUpdate:modelValue":e[0]||(e[0]=s=>t.newDate=s),color:"indigo-darken-4",label:"Весь день"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})}const Yn=ae(Un,[["render",Mn]]);var Ge=["MO","TU","WE","TH","FR","SA","SU"],B=function(){function n(e,a){if(a===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=a}return n.fromStr=function(e){return new n(Ge.indexOf(e))},n.prototype.nth=function(e){return this.n===e?this:new n(this.weekday,e)},n.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},n.prototype.toString=function(){var e=Ge[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},n.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},n}(),F=function(n){return n!=null},ie=function(n){return typeof n=="number"},st=function(n){return typeof n=="string"&&Ge.includes(n)},X=Array.isArray,se=function(n,e){e===void 0&&(e=n),arguments.length===1&&(e=n,n=0);for(var a=[],t=n;t>0,t.length>e?String(t):(e=e-t.length,e>a.length&&(a+=M(a,e/a.length)),a.slice(0,e)+String(t))}var Nn=function(n,e,a){var t=n.split(e);return a?t.slice(0,a).concat([t.slice(a).join(e)]):t},$=function(n,e){var a=n%e;return a*e<0?a+e:a},qe=function(n,e){return{div:Math.floor(n/e),mod:$(n,e)}},le=function(n){return!F(n)||n.length===0},j=function(n){return!le(n)},A=function(n,e){return j(n)&&n.indexOf(e)!==-1},we=function(n,e,a,t,r,l){return t===void 0&&(t=0),r===void 0&&(r=0),l===void 0&&(l=0),new Date(Date.UTC(n,e-1,a,t,r,l))},An=[31,28,31,30,31,30,31,31,30,31,30,31],Lt=1e3*60*60*24,Nt=9999,At=we(1970,1,1),In=[6,0,1,2,3,4,5],Ye=function(n){return n%4===0&&n%100!==0||n%400===0},It=function(n){return n instanceof Date},Ue=function(n){return It(n)&&!isNaN(n.getTime())},Rn=function(n,e){var a=n.getTime(),t=e.getTime(),r=a-t;return Math.round(r/Lt)},Ze=function(n){return Rn(n,At)},Rt=function(n){return new Date(At.getTime()+n*Lt)},Vn=function(n){var e=n.getUTCMonth();return e===1&&Ye(n.getUTCFullYear())?29:An[e]},Te=function(n){return In[n.getUTCDay()]},dt=function(n,e){var a=we(n,e+1,1);return[Te(a),Vn(a)]},Vt=function(n,e){return e=e||n,new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Je=function(n){var e=new Date(n.getTime());return e},ut=function(n){for(var e=[],a=0;athis.maxDate;if(this.method==="between"){if(a)return!0;if(t)return!1}else if(this.method==="before"){if(t)return!1}else if(this.method==="after")return a?!0:(this.add(e),!1);return this.add(e)},n.prototype.add=function(e){return this._result.push(e),!0},n.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},n.prototype.clone=function(){return new n(this.method,this.args)},n}(),Xe=function(n,e){return Xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},Xe(n,e)};function rt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xe(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}var Q=function(){return Q=Object.assign||function(e){for(var a,t=1,r=arguments.length;te[0].length)&&(e=l,a=r)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(a==="SKIP");return this.symbol=a,this.value=e,!0},n.prototype.accept=function(e){if(this.symbol===e){if(this.value){var a=this.value;return this.nextSymbol(),a}return this.nextSymbol(),!0}return!1},n.prototype.acceptNumber=function(){return this.accept("number")},n.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},n}();function Pt(n,e){e===void 0&&(e=Pe);var a={},t=new Hn(e.tokens);if(!t.start(n))return null;return r(),a;function r(){t.expect("every");var d=t.acceptNumber();if(d&&(a.interval=parseInt(d[0],10)),t.isDone())throw new Error("Unexpected end");switch(t.symbol){case"day(s)":a.freq=g.DAILY,t.nextSymbol()&&(s(),h());break;case"weekday(s)":a.freq=g.WEEKLY,a.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR],t.nextSymbol(),s(),h();break;case"week(s)":a.freq=g.WEEKLY,t.nextSymbol()&&(l(),s(),h());break;case"hour(s)":a.freq=g.HOURLY,t.nextSymbol()&&(l(),h());break;case"minute(s)":a.freq=g.MINUTELY,t.nextSymbol()&&(l(),h());break;case"month(s)":a.freq=g.MONTHLY,t.nextSymbol()&&(l(),h());break;case"year(s)":a.freq=g.YEARLY,t.nextSymbol()&&(l(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":a.freq=g.WEEKLY;var y=t.symbol.substr(0,2).toUpperCase();if(a.byweekday=[g[y]],!t.nextSymbol())return;for(;t.accept("comma");){if(t.isDone())throw new Error("Unexpected end");var p=o();if(!p)throw new Error("Unexpected symbol "+t.symbol+", expected weekday");a.byweekday.push(g[p]),t.nextSymbol()}s(),v(),h();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(a.freq=g.YEARLY,a.bymonth=[i()],!t.nextSymbol())return;for(;t.accept("comma");){if(t.isDone())throw new Error("Unexpected end");var T=i();if(!T)throw new Error("Unexpected symbol "+t.symbol+", expected month");a.bymonth.push(T),t.nextSymbol()}l(),h();break;default:throw new Error("Unknown symbol")}}function l(){var d=t.accept("on"),y=t.accept("the");if(d||y)do{var p=c(),T=o(),S=i();if(p)T?(t.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(g[T].nth(p))):(a.bymonthday||(a.bymonthday=[]),a.bymonthday.push(p),t.accept("day(s)"));else if(T)t.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(g[T]);else if(t.symbol==="weekday(s)")t.nextSymbol(),a.byweekday||(a.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR]);else if(t.symbol==="week(s)"){t.nextSymbol();var b=t.acceptNumber();if(!b)throw new Error("Unexpected symbol "+t.symbol+", expected week number");for(a.byweekno=[parseInt(b[0],10)];t.accept("comma");){if(b=t.acceptNumber(),!b)throw new Error("Unexpected symbol "+t.symbol+"; expected monthday");a.byweekno.push(parseInt(b[0],10))}}else if(S)t.nextSymbol(),a.bymonth||(a.bymonth=[]),a.bymonth.push(S);else return}while(t.accept("comma")||t.accept("the")||t.accept("on"))}function s(){var d=t.accept("at");if(d)do{var y=t.acceptNumber();if(!y)throw new Error("Unexpected symbol "+t.symbol+", expected hour");for(a.byhour=[parseInt(y[0],10)];t.accept("comma");){if(y=t.acceptNumber(),!y)throw new Error("Unexpected symbol "+t.symbol+"; expected hour");a.byhour.push(parseInt(y[0],10))}}while(t.accept("comma")||t.accept("at"))}function i(){switch(t.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function o(){switch(t.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return t.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(t.symbol){case"last":return t.nextSymbol(),-1;case"first":return t.nextSymbol(),1;case"second":return t.nextSymbol(),t.accept("last")?-2:2;case"third":return t.nextSymbol(),t.accept("last")?-3:3;case"nth":var d=parseInt(t.value[1],10);if(d<-366||d>366)throw new Error("Nth out of range: "+d);return t.nextSymbol(),t.accept("last")?-d:d;default:return!1}}function v(){t.accept("on"),t.accept("the");var d=c();if(d)for(a.bymonthday=[d],t.nextSymbol();t.accept("comma");){if(d=c(),!d)throw new Error("Unexpected symbol "+t.symbol+"; expected monthday");a.bymonthday.push(d),t.nextSymbol()}}function h(){if(t.symbol==="until"){var d=Date.parse(t.text);if(!d)throw new Error("Cannot parse until date:"+t.text);a.until=new Date(d)}else t.accept("for")&&(a.count=parseInt(t.value[0],10),t.expect("number"))}}var Y;(function(n){n[n.YEARLY=0]="YEARLY",n[n.MONTHLY=1]="MONTHLY",n[n.WEEKLY=2]="WEEKLY",n[n.DAILY=3]="DAILY",n[n.HOURLY=4]="HOURLY",n[n.MINUTELY=5]="MINUTELY",n[n.SECONDLY=6]="SECONDLY"})(Y||(Y={}));function ot(n){return n12){var t=Math.floor(this.month/12),r=$(this.month,12);this.month=r,this.year+=t,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(a,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+a*7:this.day+=-(this.getWeekday()-t)+a*7,this.fixDay()},e.prototype.addDaily=function(a){this.day+=a,this.fixDay()},e.prototype.addHours=function(a,t,r){for(t&&(this.hour+=Math.floor((23-this.hour)/a)*a);;){this.hour+=a;var l=qe(this.hour,24),s=l.div,i=l.mod;if(s&&(this.hour=i,this.addDaily(s)),le(r)||A(r,this.hour))break}},e.prototype.addMinutes=function(a,t,r,l){for(t&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/a)*a);;){this.minute+=a;var s=qe(this.minute,60),i=s.div,o=s.mod;if(i&&(this.minute=o,this.addHours(i,!1,r)),(le(r)||A(r,this.hour))&&(le(l)||A(l,this.minute)))break}},e.prototype.addSeconds=function(a,t,r,l,s){for(t&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/a)*a);;){this.second+=a;var i=qe(this.second,60),o=i.div,c=i.mod;if(o&&(this.second=c,this.addMinutes(o,!1,r,l)),(le(r)||A(r,this.hour))&&(le(l)||A(l,this.minute))&&(le(s)||A(s,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var a=dt(this.year,this.month-1)[1];if(!(this.day<=a))for(;this.day>a;){if(this.day-=a,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Nt))return;a=dt(this.year,this.month-1)[1]}}},e.prototype.add=function(a,t){var r=a.freq,l=a.interval,s=a.wkst,i=a.byhour,o=a.byminute,c=a.bysecond;switch(r){case Y.YEARLY:return this.addYears(l);case Y.MONTHLY:return this.addMonths(l);case Y.WEEKLY:return this.addWeekly(l,s);case Y.DAILY:return this.addDaily(l);case Y.HOURLY:return this.addHours(l,t,i);case Y.MINUTELY:return this.addMinutes(l,t,i,o);case Y.SECONDLY:return this.addSeconds(l,t,i,o,c)}},e}(We);function Wt(n){for(var e=[],a=Object.keys(n),t=0,r=a;t=-366&&t<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||j(e.byweekno)||j(e.byyearday)||e.bymonthday||j(e.bymonthday)||F(e.byweekday)||F(e.byeaster)))switch(e.freq){case g.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case g.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case g.WEEKLY:e.byweekday=[Te(e.dtstart)];break}if(F(e.bymonth)&&!X(e.bymonth)&&(e.bymonth=[e.bymonth]),F(e.byyearday)&&!X(e.byyearday)&&ie(e.byyearday)&&(e.byyearday=[e.byyearday]),!F(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(X(e.bymonthday)){for(var r=[],l=[],a=0;a0?r.push(t):t<0&&l.push(t)}e.bymonthday=r,e.bynmonthday=l}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(F(e.byweekno)&&!X(e.byweekno)&&(e.byweekno=[e.byweekno]),!F(e.byweekday))e.bynweekday=null;else if(ie(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(st(e.byweekday))e.byweekday=[B.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof B)!e.byweekday.n||e.freq>g.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var s=[],i=[],a=0;ag.MONTHLY?s.push(o.weekday):i.push([o.weekday,o.n])}e.byweekday=j(s)?s:null,e.bynweekday=j(i)?i:null}return F(e.byhour)?ie(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq{const n=O({});function e(a){ue.get(`api/calendar_of_events/exclusion_dates/?year=${a}`,{}).then(t=>{n.value=t.data})}return{week:n,getWeekend:e}}),hn={props:{title:{type:String,default:""},newOrOld:{type:Boolean,default:!1}},setup(n,{emit:e}){const a=O(null);return{form_valid:a,transformation:()=>{e("postData",a.value.isValid)},clearFormValidation:()=>{a.value&&a.value.resetValidation()}}}};function vn(n,e,a,t,r,l){return L(),z(xt,{"min-height":"436",class:"pa-3"},{default:f(()=>[u(Kt,{class:"pr-0 pl-2 d-flex justify-space-between"},{default:f(()=>[W(Z(a.title)+" ",1),u(Se,{icon:"mdi-close cursor-pointer",size:"small",color:"grey",onClick:e[0]||(e[0]=s=>n.$emit("closeDialog"))})]),_:1}),u(on,{ref:"form_valid",onSubmit:te(t.transformation,["prevent"])},{default:f(()=>[u(Bt,{class:"d-flex px-3"},{default:f(()=>[Gt(n.$slots,"card_text")]),_:3}),u(Zt,{class:"justify-end"},{default:f(()=>[a.newOrOld?De("",!0):(L(),z(ne,{key:0,icon:"mdi-delete",variant:"tonal",rounded:"",size:"36px",onClick:e[1]||(e[1]=s=>n.$emit("delObject"))})),u(ne,{class:"text-subtitle-1",elevation:"0",width:"150",onClick:e[2]||(e[2]=s=>n.$emit("closeDialog")),color:"btn_gray",variant:"flat"},{default:f(()=>[W("Отменить")]),_:1}),u(ne,{class:"text-subtitle-1 font-weight-regular",color:"btn_text",variant:"flat",elevation:"0",width:"150",type:"transformation"},{default:f(()=>[W(Z(a.newOrOld?"Создать":"Редактировать"),1)]),_:1})]),_:1})]),_:3},8,["onSubmit"])]),_:3})}const Mt=ae(hn,[["render",vn]]);const mn={props:{staff:{type:Array,default:()=>[]},okey:{type:String,default:"selected"}},setup(n,{emit:e}){const a=O(""),t=Ie(),r=O([]),l=H({get(){if(n.okey=="editor"){let d=[];return n.staff.forEach(y=>{let p={...y};p.employees=y.employees.filter(T=>T.selected==!0),p.employees.length>0&&d.push(p)}),d.forEach(y=>{y.employees.every(p=>p.editor==!0)&&(y.editor=!0)}),d}return n.staff}}),s=H({get(){let d=[];return n.staff.forEach(y=>{y.employees.length!=1&&y.employees.every(p=>p[n.okey]==!0)?(y[n.okey]=!0,d.push(y)):y.employees.length==1?(y[n.okey]=!0,d.push(...y.employees.filter(p=>p[n.okey]==!0))):(y[n.okey]=!1,d.push(...y.employees.filter(p=>p[n.okey]==!0)))}),d},set(d){Array.isArray(d)||i(d)}}),i=d=>{if("employees"in d)d.employees.forEach(y=>{y.id!=t.user.is_idEmployee&&(y[n.okey]=!d[n.okey])}),e("returnIdParticant",{okey:n.okey,staff:d.employees,select:[]});else if(d.length){if(d[0].id!=t.user.is_idEmployee){let y=!d.every(p=>p[n.okey]==!0);o(d,y),e("returnIdParticant",{okey:n.okey,staff:r.value,select:[]}),r.value=[]}}else d[n.okey]=!d[n.okey],e("returnIdParticant",{okey:n.okey,staff:[d],select:[]})},o=(d,y)=>{d.forEach(p=>{p.id!=t.user.is_idEmployee&&(p[n.okey]=y),"employees"in p||r.value.push(p),"employees"in p&&o(p.employees,y)})};function c(d,y){return d.includes(a.value)||y.raw.employees.some(p=>p.title.toLowerCase().includes(a.value.toLowerCase()))}return{staffed:l,filtered:a,accountStore:t,selectedStaff:s,splitname:Jt,onFilter:c,disable:d=>d.id==t.user.id_dict_department&&d.employees.length==1,allUser:()=>{i(l.value)}}}},pn=ce("span",{class:"text-body-2"}," ВСЕ СОТРУДНИКИ ",-1),bn={class:"text-body-2"};function wn(n,e,a,t,r,l){return L(),z(Ne,{modelValue:t.selectedStaff,"onUpdate:modelValue":e[2]||(e[2]=s=>t.selectedStaff=s),items:t.staffed,label:"Выберите из списка или найдите по ФИО","item-title":"title","item-value":"id","custom-filter":t.onFilter,"onUpdate:search":e[3]||(e[3]=s=>t.filtered=s),multiple:"","hide-details":"",variant:"outlined",density:"compact",class:"max-height-select py-3","return-object":""},{selection:f(({item:s})=>[u(et,{class:"me-2",color:"teal-darken-3",size:"small",label:""},{default:f(()=>[ce("span",null,Z(s.title),1),s.value!=t.accountStore.user.is_idEmployee?(L(),z(Se,{key:0,icon:"mdi-close-circle",size:"x-small",class:"ml-3",onClick:te(i=>t.selectedStaff=s.raw,["stop"])},null,8,["onClick"])):De("",!0)]),_:2},1024)]),"prepend-item":f(()=>[u(ke,{onClick:e[0]||(e[0]=te(s=>t.allUser(),["stop"])),disabled:t.staffed.length==1&&t.staffed[0].employees.length==1,class:"text-body-2"},{prepend:f(()=>[u(Me,{"model-value":t.staffed.every(s=>s[a.okey]==!0),disabled:t.staffed.length==1&&t.staffed[0].employees.length==1},null,8,["model-value","disabled"])]),default:f(()=>[pn]),_:1},8,["disabled"]),u(Xt,{class:"mt-2"})]),item:f(({props:s,item:i})=>[u(ln,Ee(s,{value:i.raw.title}),{activator:f(({props:o})=>[u(ke,Ee(o,{onClick:e[1]||(e[1]=te(()=>{},["stop"])),density:"compact",class:"text-body-2"}),{prepend:f(()=>[u(Me,{onClick:te(c=>t.selectedStaff=i.raw,["stop"]),color:"indigo-darken-4","true-value":!0,"false-value":!1,disabled:t.disable(i.raw),indeterminate:i.raw.employees.some(c=>c[a.okey]==!0)&&!i.raw.employees.every(c=>c[a.okey]==!0),"model-value":i.raw[a.okey]},null,8,["onClick","disabled","indeterminate","model-value"])]),_:2},1040)]),default:f(()=>[(L(!0),fe(be,null,Re(i.raw.employees.filter(o=>o.title.toLowerCase().includes(t.filtered.toLowerCase())),o=>(L(),z(ke,{key:o.id,value:o.title,disabled:o.id==t.accountStore.user.is_idEmployee,onClick:te(c=>t.selectedStaff=o,["stop"]),density:"compact"},{prepend:f(()=>[u(Me,{disabled:o.id==t.accountStore.user.is_idEmployee,color:"indigo-darken-4","model-value":o[a.okey]},null,8,["disabled","model-value"])]),default:f(()=>[ce("span",bn,Z(o.title),1)]),_:2},1032,["value","disabled","onClick"]))),128))]),_:2},1040,["value"])]),_:1},8,["modelValue","items","custom-filter"])}const Yt=ae(mn,[["render",wn]]),gn={props:{dateEvent:{type:String,default:""},limitation:{type:String,default:""},order:{type:Array,default:[0,0]},chek:{type:Boolean,default:!1},rule:{type:Number,default:-1}},setup(n,{emit:e}){const a=O(!1),t=O(!1),r=H({get:()=>new Date(n.dateEvent),set:h=>e("update:dateEvent",h)}),l=H({get(){return r.value},set(h){i(h,s.value)}}),s=H({get(){return`${new Date(r.value).getHours()}:${String(new Date(r.value).getMinutes()).padStart(2,"0")}`},set(h){i(l.value,h)}}),i=(h,d)=>{let y=d.split(":");d=y[0].padStart(2,"0")+":"+y[1],n.order[0]==4?d=="0:00"?r.value=h:new Date(je(h)+"T"+d)>=new Date(n.limitation)?r.value=new Date(je(h)+"T"+d):r.value=new Date(n.limitation):r.value=d=="0:00"?h:new Date(je(h)+"T"+d)};return{propsDateEvent:r,menudate:a,menutime:t,modelDate:l,formatComa:Tt,timeEvent:s,minData:()=>{let d=`${new Date(n.limitation).getHours()}:${String(new Date(n.limitation).getMinutes()).padStart(2,"0")}`=="0:00"?new Date(n.limitation):new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()-1));return new Date(d)},startMin:()=>n.rule==2?new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()-7)):!1,endMax:()=>n.rule==2?new Date(new Date(n.limitation).setDate(new Date(n.limitation).getDate()+6)):!1}}};function _n(n,e,a,t,r,l){const s=G("v-time-picker");return L(),fe(be,null,[u(k,{lg:"3",class:Le(`order-${a.order[0]}`)},{default:f(()=>[u(lt,{modelValue:t.menudate,"onUpdate:modelValue":e[2]||(e[2]=i=>t.menudate=i),"close-on-content-click":!1,"nudge-right":40,transition:"scale-transition","offset-y":""},{activator:f(({props:i})=>[u(xe,Ee({modelValue:t.modelDate,"onUpdate:modelValue":e[0]||(e[0]=o=>t.modelDate=o),value:t.formatComa(t.modelDate),density:"compact","no-resize":"","row-height":"25",rows:"1",variant:"outlined"},i,{readonly:"","hide-details":""}),{"prepend-inner":f(()=>[u(Se,Ee(i,{icon:"mdi-calendar-today",color:"cyan-darken-3",size:"x-small"}),null,16)]),_:2},1040,["modelValue","value"])]),default:f(()=>[u(tt,{locale:"ru"},{default:f(()=>[u(Ot,{modelValue:t.modelDate,"onUpdate:modelValue":e[1]||(e[1]=i=>t.modelDate=i),"show-adjacent-months":"","hide-header":"",border:"","no-time":"",max:a.order[0]==2?new Date(a.limitation):t.endMax(),min:a.order[0]==2?t.startMin():t.minData()},null,8,["modelValue","max","min"])]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["class"]),u(k,{class:Le(["flex-grow-0",`order-${a.order[1]}`])},{default:f(()=>[u(xe,{density:"compact","no-resize":"","row-height":"25",width:"75",rows:"1",readonly:"",variant:"outlined",modelValue:t.timeEvent,"onUpdate:modelValue":e[3]||(e[3]=i=>t.timeEvent=i),active:t.menutime,focus:t.menutime,"hide-details":"",disabled:a.chek},null,8,["modelValue","active","focus","disabled"]),u(lt,{modelValue:t.menutime,"onUpdate:modelValue":e[5]||(e[5]=i=>t.menutime=i),"close-on-content-click":!1,activator:"parent",transition:"scale-transition"},{default:f(()=>[t.menutime?(L(),z(s,{key:0,modelValue:t.timeEvent,"onUpdate:modelValue":e[4]||(e[4]=i=>t.timeEvent=i),"full-width":"",format:"24hr"},null,8,["modelValue"])):De("",!0)]),_:1},8,["modelValue"])]),_:1},8,["class"])],64)}const kn=ae(gn,[["render",_n]]),Dn={props:{files:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=H({get:()=>n.files,set:s=>e("update:files",s)}),t=O([]),r=H({get(){return a.value.forEach(s=>{t.value.push(l("data:text/plain;base64,aGVsbG8gd29ybGQ=",Qt(decodeURI(s.file))))}),t.value},set(s){let i=[];t.value=[],s.length==0?(t.value=[],a.value=[]):s.forEach(o=>{t.value.push(o),i.push(o)}),e("postFiles",i)}});function l(s,i){for(var o=s.split(","),c=o[0].match(/:(.*?);/)[1],v=atob(o[1]),h=v.length,d=new Uint8Array(h);h--;)d[h]=v.charCodeAt(h);return new File([d],i,{type:c})}return{eventFiles:r,arrFiles:t}}},En={key:1,class:"text-overline text-grey-darken-3 mx-2"};function xn(n,e,a,t,r,l){return L(),z(k,null,{default:f(()=>[u(sn,{label:"Файлы",chips:"",multiple:"",modelValue:t.eventFiles,"onUpdate:modelValue":e[0]||(e[0]=s=>t.eventFiles=s),density:"compact",variant:"outlined",onClick:e[1]||(e[1]=te(()=>{},["stop"]))},{selection:f(({fileNames:s})=>[(L(!0),fe(be,null,Re(s,(i,o)=>(L(),fe(be,{key:i},[o<4?(L(),z(et,{key:0,class:"me-2",color:"teal-darken-3",size:"small",label:""},{default:f(()=>[W(Z(i),1)]),_:2},1024)):o===4?(L(),fe("span",En," +"+Z(a.files.length-4)+" файла(ов) ",1)):De("",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1})}const Tn=ae(Dn,[["render",xn]]),Sn={setup(){return{values:["браузером"],items:["браузером","bar","fizz","buzz"],valuesTime:["минут"],itemsTime:["часов","минут","fizz","buzz"]}}};function Cn(n,e,a,t,r,l){return L(),z(k,{class:"flex-column d-flex"},{default:f(()=>[u(P,{"no-gutters":"",class:"map"},{default:f(()=>[u(k,{lg:"4"},{default:f(()=>[u(Ne,{modelValue:t.values,"onUpdate:modelValue":e[0]||(e[0]=s=>t.values=s),variant:"outlined",items:t.items,density:"compact",disabled:"","hide-details":""},null,8,["modelValue","items"])]),_:1}),u(k,{class:"flex-grow-0 px-2 pt-2"},{default:f(()=>[W("за")]),_:1}),u(k,{class:"flex-grow-0 pr-2"},{default:f(()=>[u(Ut,{disabled:"","min-width":"55",density:"compact",variant:"outlined","hide-details":""},{default:f(()=>[W("10")]),_:1})]),_:1}),u(k,{lg:"3"},{default:f(()=>[u(Ne,{modelValue:t.valuesTime,"onUpdate:modelValue":e[1]||(e[1]=s=>t.valuesTime=s),variant:"outlined",items:t.itemsTime,density:"compact",disabled:"","hide-details":""},null,8,["modelValue","items"])]),_:1}),u(k,{class:"flex-grow-0 pt-3 pl-3"},{default:f(()=>[u(Se,{icon:"mdi-close cursor-pointer",size:"small",color:"grey",disabled:""})]),_:1})]),_:1})]),_:1})}const On=ae(Sn,[["render",Cn]]),Un={props:{dateEventStart:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=H({get(){return t.value.allday},set(r){t.value.allday=r,r==!0&&(t.value.date_end=new Date(new Date(t.value.date_end).setHours(23,59,0)))&&(t.value.date_start=new Date(new Date(t.value.date_start).setHours(0,0,0)))}}),t=H({get:()=>n.dateEventStart,set:r=>e("update:dateEventStart",r)});return{newDate:a}}};function Mn(n,e,a,t,r,l){return L(),z(k,{class:"pb-2 pt-2 d-flex flex-column ml-n3",lg:"3"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(k,null,{default:f(()=>[u(Me,{modelValue:t.newDate,"onUpdate:modelValue":e[0]||(e[0]=s=>t.newDate=s),color:"indigo-darken-4",label:"Весь день"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})}const Yn=ae(Un,[["render",Mn]]);var Ge=["MO","TU","WE","TH","FR","SA","SU"],B=function(){function n(e,a){if(a===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=a}return n.fromStr=function(e){return new n(Ge.indexOf(e))},n.prototype.nth=function(e){return this.n===e?this:new n(this.weekday,e)},n.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},n.prototype.toString=function(){var e=Ge[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},n.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},n}(),F=function(n){return n!=null},ie=function(n){return typeof n=="number"},st=function(n){return typeof n=="string"&&Ge.includes(n)},X=Array.isArray,se=function(n,e){e===void 0&&(e=n),arguments.length===1&&(e=n,n=0);for(var a=[],t=n;t>0,t.length>e?String(t):(e=e-t.length,e>a.length&&(a+=M(a,e/a.length)),a.slice(0,e)+String(t))}var Nn=function(n,e,a){var t=n.split(e);return a?t.slice(0,a).concat([t.slice(a).join(e)]):t},$=function(n,e){var a=n%e;return a*e<0?a+e:a},qe=function(n,e){return{div:Math.floor(n/e),mod:$(n,e)}},le=function(n){return!F(n)||n.length===0},j=function(n){return!le(n)},A=function(n,e){return j(n)&&n.indexOf(e)!==-1},we=function(n,e,a,t,r,l){return t===void 0&&(t=0),r===void 0&&(r=0),l===void 0&&(l=0),new Date(Date.UTC(n,e-1,a,t,r,l))},An=[31,28,31,30,31,30,31,31,30,31,30,31],Lt=1e3*60*60*24,Nt=9999,At=we(1970,1,1),In=[6,0,1,2,3,4,5],Ye=function(n){return n%4===0&&n%100!==0||n%400===0},It=function(n){return n instanceof Date},Ue=function(n){return It(n)&&!isNaN(n.getTime())},Rn=function(n,e){var a=n.getTime(),t=e.getTime(),r=a-t;return Math.round(r/Lt)},Ze=function(n){return Rn(n,At)},Rt=function(n){return new Date(At.getTime()+n*Lt)},Vn=function(n){var e=n.getUTCMonth();return e===1&&Ye(n.getUTCFullYear())?29:An[e]},Te=function(n){return In[n.getUTCDay()]},dt=function(n,e){var a=we(n,e+1,1);return[Te(a),Vn(a)]},Vt=function(n,e){return e=e||n,new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Je=function(n){var e=new Date(n.getTime());return e},ut=function(n){for(var e=[],a=0;athis.maxDate;if(this.method==="between"){if(a)return!0;if(t)return!1}else if(this.method==="before"){if(t)return!1}else if(this.method==="after")return a?!0:(this.add(e),!1);return this.add(e)},n.prototype.add=function(e){return this._result.push(e),!0},n.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},n.prototype.clone=function(){return new n(this.method,this.args)},n}(),Xe=function(n,e){return Xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])},Xe(n,e)};function rt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xe(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}var Q=function(){return Q=Object.assign||function(e){for(var a,t=1,r=arguments.length;te[0].length)&&(e=l,a=r)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(a==="SKIP");return this.symbol=a,this.value=e,!0},n.prototype.accept=function(e){if(this.symbol===e){if(this.value){var a=this.value;return this.nextSymbol(),a}return this.nextSymbol(),!0}return!1},n.prototype.acceptNumber=function(){return this.accept("number")},n.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},n}();function Pt(n,e){e===void 0&&(e=Pe);var a={},t=new Hn(e.tokens);if(!t.start(n))return null;return r(),a;function r(){t.expect("every");var d=t.acceptNumber();if(d&&(a.interval=parseInt(d[0],10)),t.isDone())throw new Error("Unexpected end");switch(t.symbol){case"day(s)":a.freq=g.DAILY,t.nextSymbol()&&(s(),h());break;case"weekday(s)":a.freq=g.WEEKLY,a.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR],t.nextSymbol(),s(),h();break;case"week(s)":a.freq=g.WEEKLY,t.nextSymbol()&&(l(),s(),h());break;case"hour(s)":a.freq=g.HOURLY,t.nextSymbol()&&(l(),h());break;case"minute(s)":a.freq=g.MINUTELY,t.nextSymbol()&&(l(),h());break;case"month(s)":a.freq=g.MONTHLY,t.nextSymbol()&&(l(),h());break;case"year(s)":a.freq=g.YEARLY,t.nextSymbol()&&(l(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":a.freq=g.WEEKLY;var y=t.symbol.substr(0,2).toUpperCase();if(a.byweekday=[g[y]],!t.nextSymbol())return;for(;t.accept("comma");){if(t.isDone())throw new Error("Unexpected end");var p=o();if(!p)throw new Error("Unexpected symbol "+t.symbol+", expected weekday");a.byweekday.push(g[p]),t.nextSymbol()}s(),v(),h();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(a.freq=g.YEARLY,a.bymonth=[i()],!t.nextSymbol())return;for(;t.accept("comma");){if(t.isDone())throw new Error("Unexpected end");var T=i();if(!T)throw new Error("Unexpected symbol "+t.symbol+", expected month");a.bymonth.push(T),t.nextSymbol()}l(),h();break;default:throw new Error("Unknown symbol")}}function l(){var d=t.accept("on"),y=t.accept("the");if(d||y)do{var p=c(),T=o(),S=i();if(p)T?(t.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(g[T].nth(p))):(a.bymonthday||(a.bymonthday=[]),a.bymonthday.push(p),t.accept("day(s)"));else if(T)t.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(g[T]);else if(t.symbol==="weekday(s)")t.nextSymbol(),a.byweekday||(a.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR]);else if(t.symbol==="week(s)"){t.nextSymbol();var b=t.acceptNumber();if(!b)throw new Error("Unexpected symbol "+t.symbol+", expected week number");for(a.byweekno=[parseInt(b[0],10)];t.accept("comma");){if(b=t.acceptNumber(),!b)throw new Error("Unexpected symbol "+t.symbol+"; expected monthday");a.byweekno.push(parseInt(b[0],10))}}else if(S)t.nextSymbol(),a.bymonth||(a.bymonth=[]),a.bymonth.push(S);else return}while(t.accept("comma")||t.accept("the")||t.accept("on"))}function s(){var d=t.accept("at");if(d)do{var y=t.acceptNumber();if(!y)throw new Error("Unexpected symbol "+t.symbol+", expected hour");for(a.byhour=[parseInt(y[0],10)];t.accept("comma");){if(y=t.acceptNumber(),!y)throw new Error("Unexpected symbol "+t.symbol+"; expected hour");a.byhour.push(parseInt(y[0],10))}}while(t.accept("comma")||t.accept("at"))}function i(){switch(t.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function o(){switch(t.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return t.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(t.symbol){case"last":return t.nextSymbol(),-1;case"first":return t.nextSymbol(),1;case"second":return t.nextSymbol(),t.accept("last")?-2:2;case"third":return t.nextSymbol(),t.accept("last")?-3:3;case"nth":var d=parseInt(t.value[1],10);if(d<-366||d>366)throw new Error("Nth out of range: "+d);return t.nextSymbol(),t.accept("last")?-d:d;default:return!1}}function v(){t.accept("on"),t.accept("the");var d=c();if(d)for(a.bymonthday=[d],t.nextSymbol();t.accept("comma");){if(d=c(),!d)throw new Error("Unexpected symbol "+t.symbol+"; expected monthday");a.bymonthday.push(d),t.nextSymbol()}}function h(){if(t.symbol==="until"){var d=Date.parse(t.text);if(!d)throw new Error("Cannot parse until date:"+t.text);a.until=new Date(d)}else t.accept("for")&&(a.count=parseInt(t.value[0],10),t.expect("number"))}}var Y;(function(n){n[n.YEARLY=0]="YEARLY",n[n.MONTHLY=1]="MONTHLY",n[n.WEEKLY=2]="WEEKLY",n[n.DAILY=3]="DAILY",n[n.HOURLY=4]="HOURLY",n[n.MINUTELY=5]="MINUTELY",n[n.SECONDLY=6]="SECONDLY"})(Y||(Y={}));function ot(n){return n12){var t=Math.floor(this.month/12),r=$(this.month,12);this.month=r,this.year+=t,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(a,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+a*7:this.day+=-(this.getWeekday()-t)+a*7,this.fixDay()},e.prototype.addDaily=function(a){this.day+=a,this.fixDay()},e.prototype.addHours=function(a,t,r){for(t&&(this.hour+=Math.floor((23-this.hour)/a)*a);;){this.hour+=a;var l=qe(this.hour,24),s=l.div,i=l.mod;if(s&&(this.hour=i,this.addDaily(s)),le(r)||A(r,this.hour))break}},e.prototype.addMinutes=function(a,t,r,l){for(t&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/a)*a);;){this.minute+=a;var s=qe(this.minute,60),i=s.div,o=s.mod;if(i&&(this.minute=o,this.addHours(i,!1,r)),(le(r)||A(r,this.hour))&&(le(l)||A(l,this.minute)))break}},e.prototype.addSeconds=function(a,t,r,l,s){for(t&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/a)*a);;){this.second+=a;var i=qe(this.second,60),o=i.div,c=i.mod;if(o&&(this.second=c,this.addMinutes(o,!1,r,l)),(le(r)||A(r,this.hour))&&(le(l)||A(l,this.minute))&&(le(s)||A(s,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var a=dt(this.year,this.month-1)[1];if(!(this.day<=a))for(;this.day>a;){if(this.day-=a,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Nt))return;a=dt(this.year,this.month-1)[1]}}},e.prototype.add=function(a,t){var r=a.freq,l=a.interval,s=a.wkst,i=a.byhour,o=a.byminute,c=a.bysecond;switch(r){case Y.YEARLY:return this.addYears(l);case Y.MONTHLY:return this.addMonths(l);case Y.WEEKLY:return this.addWeekly(l,s);case Y.DAILY:return this.addDaily(l);case Y.HOURLY:return this.addHours(l,t,i);case Y.MINUTELY:return this.addMinutes(l,t,i,o);case Y.SECONDLY:return this.addSeconds(l,t,i,o,c)}},e}(We);function Wt(n){for(var e=[],a=Object.keys(n),t=0,r=a;t=-366&&t<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||j(e.byweekno)||j(e.byyearday)||e.bymonthday||j(e.bymonthday)||F(e.byweekday)||F(e.byeaster)))switch(e.freq){case g.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case g.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case g.WEEKLY:e.byweekday=[Te(e.dtstart)];break}if(F(e.bymonth)&&!X(e.bymonth)&&(e.bymonth=[e.bymonth]),F(e.byyearday)&&!X(e.byyearday)&&ie(e.byyearday)&&(e.byyearday=[e.byyearday]),!F(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(X(e.bymonthday)){for(var r=[],l=[],a=0;a0?r.push(t):t<0&&l.push(t)}e.bymonthday=r,e.bynmonthday=l}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(F(e.byweekno)&&!X(e.byweekno)&&(e.byweekno=[e.byweekno]),!F(e.byweekday))e.bynweekday=null;else if(ie(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(st(e.byweekday))e.byweekday=[B.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof B)!e.byweekday.n||e.freq>g.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var s=[],i=[],a=0;ag.MONTHLY?s.push(o.weekday):i.push([o.weekday,o.n])}e.byweekday=j(s)?s:null,e.bynweekday=j(i)?i:null}return F(e.byhour)?ie(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(v=0,c=i.yearlen+$(s-e.wkst,7)):c=t-v;for(var h=Math.floor(c/7),d=$(c,7),y=Math.floor(h+d/4),p=0;p0&&T<=y){var S=void 0;T>1?(S=v+(T-1)*7,v!==o&&(S-=7-o)):S=v;for(var b=0;b<7&&(i.wnomask[S]=1,S++,i.wdaymask[S]!==e.wkst);b++);}}if(A(e.byweekno,1)){var S=v+y*7;if(v!==o&&(S-=7-o),S=4?(E=0,x=_+$(I-e.wkst,7)):x=t-v,C=Math.floor(52+$(x,7)/4)}if(A(e.byweekno,C))for(var S=0;Sl)return de(n);if(C>=a){var I=pt(C,e);if(!n.accept(I)||i&&(--i,!i))return de(n)}}else for(var b=y;bl)return de(n);if(C>=a){var I=pt(C,e);if(!n.accept(I)||i&&(--i,!i))return de(n)}}}if(e.interval===0||(o.add(e,T),o.year>Nt))return de(n);ot(t)||(v=c.gettimeset(t)(o.hour,o.minute,o.second,0)),c.rebuild(o.year,o.month)}}function wa(n,e,a){var t=a.bymonth,r=a.byweekno,l=a.byweekday,s=a.byeaster,i=a.bymonthday,o=a.bynmonthday,c=a.byyearday;return j(t)&&!A(t,n.mmask[e])||j(r)&&!n.wnomask[e]||j(l)&&!A(l,n.wdaymask[e])||j(n.nwdaymask)&&!n.nwdaymask[e]||s!==null&&!A(n.eastermask,e)||(j(i)||j(o))&&!A(i,n.mdaymask[e])&&!A(o,n.nmdaymask[e])||j(c)&&(e=n.yearlen&&!A(c,e+1-n.yearlen)&&!A(c,-n.nextyearlen+e-n.yearlen))}function pt(n,e){return new He(n,e.tzid).rezonedDate()}function de(n){return n.getValue()}function ga(n,e,a,t,r){for(var l=!1,s=e;s=g.HOURLY&&j(r)&&!A(r,e.hour)||t>=g.MINUTELY&&j(l)&&!A(l,e.minute)||t>=g.SECONDLY&&j(s)&&!A(s,e.second)?[]:n.gettimeset(t)(e.hour,e.minute,e.second,e.millisecond)}var ee={MO:new B(0),TU:new B(1),WE:new B(2),TH:new B(3),FR:new B(4),SA:new B(5),SU:new B(6)},it={freq:Y.YEARLY,dtstart:null,interval:1,wkst:ee.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},ka=Object.keys(it),g=function(){function n(e,a){e===void 0&&(e={}),a===void 0&&(a=!1),this._cache=a?null:new ea,this.origOptions=Wt(e);var t=Bn(e).parsedOptions;this.options=t}return n.parseText=function(e,a){return Pt(e,a)},n.fromText=function(e,a){return Fn(e,a)},n.fromString=function(e){return new n(n.parseString(e)||void 0)},n.prototype._iter=function(e){return zt(e,this.options)},n.prototype._cacheGet=function(e,a){return this._cache?this._cache._cacheGet(e,a):!1},n.prototype._cacheAdd=function(e,a,t){if(this._cache)return this._cache._cacheAdd(e,a,t)},n.prototype.all=function(e){if(e)return this._iter(new ft("all",{},e));var a=this._cacheGet("all");return a===!1&&(a=this._iter(new _e("all",{})),this._cacheAdd("all",a)),a},n.prototype.between=function(e,a,t,r){if(t===void 0&&(t=!1),!Ue(e)||!Ue(a))throw new Error("Invalid date passed in to RRule.between");var l={before:a,after:e,inc:t};if(r)return this._iter(new ft("between",l,r));var s=this._cacheGet("between",l);return s===!1&&(s=this._iter(new _e("between",l)),this._cacheAdd("between",s,l)),s},n.prototype.before=function(e,a){if(a===void 0&&(a=!1),!Ue(e))throw new Error("Invalid date passed in to RRule.before");var t={dt:e,inc:a},r=this._cacheGet("before",t);return r===!1&&(r=this._iter(new _e("before",t)),this._cacheAdd("before",r,t)),r},n.prototype.after=function(e,a){if(a===void 0&&(a=!1),!Ue(e))throw new Error("Invalid date passed in to RRule.after");var t={dt:e,inc:a},r=this._cacheGet("after",t);return r===!1&&(r=this._iter(new _e("after",t)),this._cacheAdd("after",r,t)),r},n.prototype.count=function(){return this.all().length},n.prototype.toString=function(){return $e(this.origOptions)},n.prototype.toText=function(e,a,t){return jn(this,e,a,t)},n.prototype.isFullyConvertibleToText=function(){return qn(this)},n.prototype.clone=function(){return new n(this.origOptions)},n.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],n.YEARLY=Y.YEARLY,n.MONTHLY=Y.MONTHLY,n.WEEKLY=Y.WEEKLY,n.DAILY=Y.DAILY,n.HOURLY=Y.HOURLY,n.MINUTELY=Y.MINUTELY,n.SECONDLY=Y.SECONDLY,n.MO=ee.MO,n.TU=ee.TU,n.WE=ee.WE,n.TH=ee.TH,n.FR=ee.FR,n.SA=ee.SA,n.SU=ee.SU,n.parseString=Qe,n.optionsToString=$e,n}();function Da(n,e,a,t,r,l){var s={},i=n.accept;function o(d,y){a.forEach(function(p){p.between(d,y,!0).forEach(function(T){s[Number(T)]=!0})})}r.forEach(function(d){var y=new He(d,l).rezonedDate();s[Number(y)]=!0}),n.accept=function(d){var y=Number(d);return isNaN(y)?i.call(this,d):!s[y]&&(o(new Date(y-1),new Date(y+1)),!s[y])?(s[y]=!0,i.call(this,d)):!0},n.method==="between"&&(o(n.args.after,n.args.before),n.accept=function(d){var y=Number(d);return s[y]?!0:(s[y]=!0,i.call(this,d))});for(var c=0;c1||r.length||l.length||s.length){var v=new Ma(c);return v.dtstart(i),v.tzid(o||void 0),t.forEach(function(d){v.rrule(new g(Ke(d,i,o),c))}),r.forEach(function(d){v.rdate(d)}),l.forEach(function(d){v.exrule(new g(Ke(d,i,o),c))}),s.forEach(function(d){v.exdate(d)}),e.compatible&&e.dtstart&&v.rdate(i),v}var h=t[0]||{};return new g(Ke(h,h.dtstart||e.dtstart||i,h.tzid||e.tzid||o),c)}function wt(n,e){return e===void 0&&(e={}),xa(n,Ta(e))}function Ke(n,e,a){return Q(Q({},n),{dtstart:e,tzid:a})}function Ta(n){var e=[],a=Object.keys(n),t=Object.keys(bt);if(a.forEach(function(r){A(t,r)||e.push(r)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Q(Q({},bt),n)}function Sa(n){if(n.indexOf(":")===-1)return{name:"RRULE",value:n};var e=Nn(n,":",1),a=e[0],t=e[1];return{name:a,value:t}}function Ca(n){var e=Sa(n),a=e.name,t=e.value,r=a.split(";");if(!r)throw new Error("empty property name");return{name:r[0].toUpperCase(),parms:r.slice(1),value:t}}function Oa(n,e){if(e===void 0&&(e=!1),n=n&&n.trim(),!n)throw new Error("Invalid empty string");if(!e)return n.split(/\s/);for(var a=n.split(` `),t=0;t0&&r[0]===" "?(a[t-1]+=r.slice(1),a.splice(t,1)):t+=1:a.splice(t,1)}return a}function Ua(n){n.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function gt(n,e){return Ua(e),n.split(",").map(function(a){return at(a)})}function _t(n){var e=this;return function(a){if(a!==void 0&&(e["_".concat(n)]=a),e["_".concat(n)]!==void 0)return e["_".concat(n)];for(var t=0;t{}}},setup(n,{emit:e}){const a=O(null),t=H({get:()=>n.eventCalendar,set:w=>e("update:eventCalendar",w)}),r=[{type:"Не повторять",rule:{},id:1},{type:"Каждый день",rule:{freq:3},id:2},{type:"Каждую неделю",rule:{freq:2},id:3},{type:"Каждый месяц",rule:{freq:1},id:4},{type:"Каждый год",rule:{freq:0},id:5}],l=H({get(){let w="";if(t.value.event.period!=null){let D=JSON.parse(t.value.event.period);D!=null&&(s(D.origOptions),r.findIndex(U=>U.rule.freq==D.origOptions.freq),w=r[r.findIndex(U=>U.rule.freq==D.origOptions.freq)])}else w=r[0].type;return E(),w},set(w){s(w.rule)}}),s=w=>{let D;w.freq==3&&(D=new g({...w,dtstart:new Date(t.value.event.date_start),until:new Date(t.value.event.date_end)})),w.freq==2&&(D=new g({...w,dtstart:new Date(t.value.event.date_start),byweekday:Oe()})),w.freq==1&&(D=new g({...w,bymonthday:me(),dtstart:new Date(t.value.event.date_start)})),w.freq==0&&(D=new g({...w,bymonthday:Ve(),dtstart:new Date(t.value.event.date_start),bymonth:pe()})),Object.keys(w).length==0?t.value.event.period=null:t.value.event.period=JSON.stringify(D)},i=[g.SU,g.MO,g.TU,g.WE,g.TH,g.FR,g.SA],o=St().alert,c=w=>!!w||"Поле обязательно",v={name:[w=>c(w)]},h=O([]);ue.get("api/calendar_of_events/get_employees/").then(w=>{h.value=w.data.filter(D=>D.employees.length>0)});const d=Ie(),y=H({get(){let w=[],D=t.value.mycalendars.findIndex(U=>U.id==b.value[0].id);return h.value.forEach(U=>{let R={...U};R.employees=U.employees.filter(V=>((V.id==d.user.is_idEmployee||t.value.event.participant.some(oe=>V.id==oe))&&(V.selected=!0),t.value.mycalendars[D].participant.some(oe=>oe.id===V.id))),R.employees.length>0&&w.push(R)}),w}}),p=w=>{ue.delete(`api/calendar_of_events/my_events/?delid=${w}`).then(D=>{o.alert=!0,o.text=D.data.mess,o.ico="mdi-check",o.color="orange-accent-1",e("getCalendar")}),e("closeDialog")},T=O([]),S=w=>{T.value=w},b=H({get(){let w=[];if(t.value.event.calendar){let D=t.value.mycalendars.findIndex(U=>U.id==t.value.event.calendar);w.push({cl_name:t.value.mycalendars[D].cl_name,cl_color:t.value.mycalendars[D].cl_color,id:t.value.mycalendars[D].id})}else w.push({cl_name:t.value.mycalendars[0].cl_name,cl_color:t.value.mycalendars[0].cl_color,id:t.value.mycalendars[0].id});return t.value.event.calendar==null&&(t.value.event.calendar=t.value.mycalendars[0].id),w},set(w){t.value.event.calendar=w.value}}),C=O(""),I=O(!1),E=()=>{t.value.event.hasOwnProperty("id")?(C.value="Редактирование события",I.value=!1):(C.value="Новое событие",I.value=!0)},_=w=>{w.staff.forEach(D=>{if(D.selected==!0&&!t.value.event.participant.includes(D.id))t.value.event.participant.push(D.id);else{let U=t.value.event.participant.findIndex(R=>R==D.id);U!=-1&&t.value.event.participant.splice(U,1)}})},x=H({get(){return Tt(new Date(t.value.event.date_start))},set(w){w.split(".")}}),N=O(!1),re=w=>{if(w){let D=new FormData;D.append("event",JSON.stringify({...t.value.event})),t.value.event.files!==null&&T.value.forEach(U=>D.append("files",U)),ue.post("api/calendar_of_events/my_events/",D).then(U=>{o.alert=!0,o.text=U.data.mess,o.ico="mdi-check",o.color="green-darken-4",e("getCalendar"),e("closeDialog")})}},Oe=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getDay(),R=D.getDay();const V=[];if(w.getDay()>D.getDay()){R=6;for(let J=U;J<=R;J++)V.push(J)}if(w.getDay()!=D.getDay()&&w.getDay()>D.getDay()){U=0;for(let J=U;J<=D.getDay();J++)V.push(J)}if(w.getDay(){oe.push(i[J])}),oe},me=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getDate(),R=D.getDate();const V=[];for(let oe=U;oe<=R;oe++)V.push(oe);return console.log(V.length,"дни в месяце"),V},Ve=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=Fe(w,D),R=[];return U.forEach(V=>R.push(new Date(V).getDate())),R},pe=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getMonth(),R=D.getMonth(),V=[];return V.push(U+1),V.includes(R+1)||V.push(R+1),console.log(V,"month"),V},Fe=(w,D)=>{let U=[],R=new Date(w);for(;R<=D;)U.push(new Date(R)),R.setDate(R.getDate()+1);return U},Ht=w=>{console.log(w,"?????????????????????????????????")},Ft=w=>jt.value>=7&&w==3,jt=H({get(){const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end),U=1e3*60*60*24,R=D.getTime()-w.getTime();return Math.round(R/U)}});return{menudate:N,titleCard:C,newEvent:I,propsEvent:t,dateEvent:x,calendar:b,staff:h,newStaff:y,returnIdParticant:_,postFiles:S,postData:re,rules:v,delEvent:p,repeatRules:r,returnPeriod:l,periodDisplayRule:Ft,what:Ht,createDialog:a,getMonthBetweenDates:me}}},La={class:"pl-2"};function Na(n,e,a,t,r,l){const s=G("calendar-create-select"),i=G("time-select"),o=G("period-events"),c=G("reminder-event"),v=G("uploading-file"),h=G("dialog-create");return L(),z(h,{title:t.titleCard,newOrOld:t.newEvent,onPostData:t.postData,onCloseDialog:e[8]||(e[8]=d=>n.$emit("closeDialog")),onDelObject:e[9]||(e[9]=d=>t.delEvent(t.propsEvent.event.id)),ref:"createDialog"},{card_text:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Название ")]),_:1}),u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Добавить название","row-height":"25",rows:"1",variant:"outlined",modelValue:t.propsEvent.event.name,"onUpdate:modelValue":e[0]||(e[0]=d=>t.propsEvent.event.name=d),rules:t.rules.name},null,8,["modelValue","rules"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Участники ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Календарь")]),_:1}),u(k,null,{default:f(()=>[u(Ne,{modelValue:t.calendar,"onUpdate:modelValue":e[1]||(e[1]=d=>t.calendar=d),items:t.propsEvent.mycalendars,label:"Выберите календарь или найдите по названию","item-title":"cl_name","item-value":"id","hide-details":"",variant:"outlined",density:"compact",class:"py-3","return-object":"",disabled:"id"in t.propsEvent.event},{selection:f(({item:d})=>[u(Be,{class:"cursor-pointer",size:"8",color:d.raw.cl_color},null,8,["color"]),ce("span",La,Z(d.title),1)]),item:f(({item:d})=>[(L(),z(ke,{key:d.title,value:d,color:"primary",onClick:te(y=>t.calendar=d,["stop"])},{prepend:f(()=>[u(Be,{class:"cursor-pointer",size:"8",color:d.raw.cl_color},null,8,["color"])]),default:f(()=>[W(" "+Z(d.title),1)]),_:2},1032,["value","onClick"]))]),_:1},8,["modelValue","items","disabled"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-top"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pt-3",lg:"2"},{default:f(()=>[W(" Дата и время ")]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(i,{rule:t.returnPeriod!=t.repeatRules[0].type?t.returnPeriod.rule.freq:-1,chek:t.propsEvent.event.allday,order:[2,1],dateEvent:String(t.propsEvent.event.date_start),limitation:String(t.propsEvent.event.date_end),"onUpdate:dateEvent":e[2]||(e[2]=d=>t.propsEvent.event.date_start=d)},null,8,["rule","chek","dateEvent","limitation"]),u(k,{class:"order-3 flex-grow-0"},{default:f(()=>[u(Se,{icon:"mdi-minus pt-4",color:"grey-darken-1"})]),_:1}),u(i,{rule:t.returnPeriod!=t.repeatRules[0].type?t.returnPeriod.rule.freq:-1,chek:t.propsEvent.event.allday,order:[4,5],dateEvent:String(t.propsEvent.event.date_end),limitation:String(t.propsEvent.event.date_start),"onUpdate:dateEvent":e[3]||(e[3]=d=>t.propsEvent.event.date_end=d)},null,8,["rule","chek","dateEvent","limitation"])]),_:1}),u(P,{"no-gutters":""},{default:f(()=>[u(o,{dateEventStart:t.propsEvent.event,"onUpdate:dateEventStart":e[4]||(e[4]=d=>t.propsEvent.event=d)},null,8,["dateEventStart"]),u(k,{lg:"7",class:"pt-2 ml-5"},{default:f(()=>[u(Ne,{modelValue:t.returnPeriod,"onUpdate:modelValue":e[5]||(e[5]=d=>t.returnPeriod=d),items:t.repeatRules,variant:"outlined",density:"compact","return-object":"","item-title":"type","item-value":"id"},{item:f(({props:d,item:y})=>[(L(),z(ke,Ee(d,{key:y.title,value:y,color:"primary",disabled:t.periodDisplayRule(y.raw.id),onClick:p=>t.returnPeriod=y.raw}),null,16,["value","disabled","onClick"]))]),_:1},8,["modelValue","items"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-top flex-grow-0"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pt-3 h-0",lg:"2"},{default:f(()=>[W(" Напоминание ")]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap flex-grow-0"},{default:f(()=>[u(c)]),_:1}),u(P,{"no-gutters":"",class:"flex-grow-0"},{default:f(()=>[u(k,null,{default:f(()=>[u(ne,{disabled:"","prepend-icon":"mdi-plus",variant:"text",class:"text-body-2 text-text_grey"},{default:f(()=>[W(" Добавить уведомление ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Файлы ")]),_:1}),u(v,{files:t.propsEvent.event.files,"onUpdate:files":e[6]||(e[6]=d=>t.propsEvent.event.files=d),onPostFiles:t.postFiles},null,8,["files","onPostFiles"])]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Дополнительное описание","row-height":"25",rows:"3",variant:"outlined",modelValue:t.propsEvent.event.description,"onUpdate:modelValue":e[7]||(e[7]=d=>t.propsEvent.event.description=d)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["title","newOrOld","onPostData"])}const Aa=ae(Ya,[["render",Na]]);const Ia={components:{calendarCreateSelect:Yt,DialogCreate:Mt},props:{calendar:{type:Object,default:{}}},setup(n,{emit:e}){const a=Ie(),t=b=>{b.staff.forEach(C=>{let I=r.value.participant.findIndex(_=>_.participant_calendar==C.id),E=r.value.participant.find(_=>_.participant_calendar==C.id);if(b.okey=="editor")E.editor=C.editor;else if(C.selected==!0)C.id!=a.user.is_idEmployee&&I==-1&&r.value.participant.push({editor:!1,participant_calendar:C.id});else{let _=r.value.participant.findIndex(x=>x.participant_calendar==C.id);_!=-1&&r.value.participant.splice(_,1)}})},r=H({get:()=>n.calendar,set:b=>e("update:calendar",b)}),l=St().alert,s={cl_name:[b=>S(b)],cl_descr:[b=>S(b)]},i=O(""),o=O(!1);(()=>{r.value.hasOwnProperty("id")?(i.value="Редактирование календаря",r.value.author!=a.user.is_idEmployee&&(o.value=!0)):(i.value="Новый календарь",o.value=!0)})();const v=b=>{b&&ue.post("api/calendar_of_events/my_calendars/",{...n.calendar,participant:r.value.participant}).then(C=>{l.alert=!0,l.text=C.data.mess,l.ico="mdi-check",l.color="green-darken-4",e("getCalendar"),e("closeDialog")})},h=O([]);ue.get("api/calendar_of_events/get_employees/").then(b=>{h.value=b.data.filter(C=>C.employees.length>0)});const d=H({get(){return h.value.forEach(b=>{r.value.participant.length>0&&b.employees.forEach(C=>{let I=r.value.participant.find(E=>E.participant_calendar===C.id);I?(C.selected=!0,C.editor=I.editor):(C.selected=!1,C.editor=!1)})}),h.value}}),y=["red","pink","deep-orange","amber","yellow","lime","light-green","green","light-blue","blue","indigo","deep-purple","purple","blue-grey","brown"],p=b=>{r.value.cl_color===b?r.value.cl_color=null:r.value.cl_color=b},T=b=>{ue.delete(`api/calendar_of_events/my_calendars/?delid=${b}`).then(C=>{l.alert=!0,l.text=C.data.mess,l.ico="mdi-check",l.color="orange-accent-1",e("getCalendar")}),e("closeDialog")},S=b=>!!b||"Поле обязательно";return{postCalendar:v,color:y,colorPik:p,returnIdParticant:t,propsCalendar:r,delCalendar:T,rules:s,titleCard:i,newCalendar:o,newStaff:d}}},Ra=ce("div",{class:"custom-tooltip"}," Участники с доступом редактирования смогут изменять поля календаря, а также редактировать и удалять события ",-1);function Va(n,e,a,t,r,l){const s=G("calendar-create-select"),i=G("dialog-create");return L(),z(i,{title:t.titleCard,newOrOld:t.newCalendar,onCloseDialog:e[2]||(e[2]=o=>n.$emit("closeDialog")),onDelObject:e[3]||(e[3]=o=>t.delCalendar(t.propsCalendar.id)),onPostData:t.postCalendar},{card_text:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Название ")]),_:1}),u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Описание","row-height":"25",rows:"1",variant:"outlined",modelValue:t.propsCalendar.cl_name,"onUpdate:modelValue":e[0]||(e[0]=o=>t.propsCalendar.cl_name=o),rules:t.rules.cl_name},null,8,["modelValue","rules"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Цвет ")]),_:1}),(L(!0),fe(be,null,Re(t.color,(o,c)=>(L(),z(k,{key:c},{default:f(()=>[u(Be,{class:"cursor-pointer",onClick:v=>t.colorPik(o,c),size:"x-small",color:o,variant:t.propsCalendar.cl_color===null||t.propsCalendar.cl_color===o?"flat":"tonal"},null,8,["onClick","color","variant"])]),_:2},1024))),128))]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Участники ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1})]),_:1})]),_:1}),u(k,{class:"d-flex flex-grow-0"},{default:f(()=>[u(xe,{density:"compact",label:"Описание","row-height":"25",rows:"4",variant:"outlined",shaped:"","no-resize":"",rules:t.rules.cl_descr,modelValue:t.propsCalendar.cl_descr,"onUpdate:modelValue":e[1]||(e[1]=o=>t.propsCalendar.cl_descr=o)},null,8,["rules","modelValue"])]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Редакторы ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,okey:"editor",onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1}),u(k,{lg:"1",class:"text-center"},{default:f(()=>[u($t,{location:"top"},{activator:f(({props:o})=>[u(Se,Ee(o,{icon:"mdi-help-circle-outline"}),null,16)]),default:f(()=>[Ra]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["title","newOrOld","onPostData"])}const Pa=ae(Ia,[["render",Va]]);const Wa={components:{calendarCreate:Pa},props:{calendars:{type:Array,default:()=>[]},title:{typr:String,default:""}},setup(n,{emit:e}){const a=O(!1),t=Ie(),r=O({}),l=O([0]),s=O(!1),i=O(0);return{showDialog:a,calendar:r,editCreatedCalendar:v=>{v===void 0?r.value={cl_name:"",participant:[{editor:!0,participant_calendar:t.user.is_idEmployee}],cl_color:"red",cl_descr:""}:r.value=v,a.value=!0},chekUpdate:v=>{let h=new Set(t.calendar);v.visible==!1?h.add(v.id):h.delete(v.id),t.calendar=Array.from(h)},accountStore:t,openGroup:l,trans:s,hover:i}}},za={class:"text-subtitle-2"},Ha={class:"text-body-2"},Fa={key:1,class:"text-caption text-grey text-center"};function ja(n,e,a,t,r,l){const s=G("calendar-create");return L(),z(fn,{class:"calendar",variant:"accordion",flat:"",tile:"",static:"",modelValue:t.openGroup,"onUpdate:modelValue":e[7]||(e[7]=i=>t.openGroup=i)},{default:f(()=>[u(cn,{elevation:"0",flat:"",tile:"",static:""},{default:f(()=>[u(dn,{flat:"",tile:"",static:"",class:"py-0 px-3"},{default:f(()=>[ce("div",{onClick:e[0]||(e[0]=te(()=>{},["stop"]))},[ce("span",za,Z(a.title),1)]),a.title=="Мои календари"?(L(),z(ne,{key:0,size:"x-small",icon:"mdi-plus",variant:"text",class:"pa-0",onClick:e[1]||(e[1]=te(i=>t.editCreatedCalendar(),["stop"]))})):De("",!0)]),_:1}),u(un,{flat:"",tile:"",static:""},{default:f(()=>[Object.keys(a.calendars).length>0?(L(!0),fe(be,{key:0},Re(a.calendars,(i,o)=>(L(),z(ke,{key:o,value:i.cl_name,onMouseenter:c=>t.hover=o,onMouseleave:e[2]||(e[2]=c=>t.hover=null),class:Le([{trasitlist:t.hover===o},"pa-0 cursor-default"])},{prepend:f(()=>[u(Me,{class:Le(["text-caption",`text-${i.cl_color}`]),modelValue:i.visible,"onUpdate:modelValue":[c=>i.visible=c,c=>t.chekUpdate(i)],color:i.cl_color},null,8,["class","modelValue","onUpdate:modelValue","color"])]),title:f(()=>[ce("span",Ha,Z(i.cl_name),1)]),append:f(()=>[u(en,{name:"fade"},{default:f(()=>[i.author==t.accountStore.user.is_idEmployee||i.participant.some(c=>c.editor==!0&&c.participant_calendar==t.accountStore.user.is_idEmployee)?(L(),z(ne,{key:0,size:"x-small",icon:"mdi-pen",variant:"text",class:"transitbtn",onClick:te(c=>t.editCreatedCalendar(i),["stop"])},null,8,["onClick"])):De("",!0)]),_:2},1024)]),_:2},1032,["value","onMouseenter","class"]))),128)):(L(),fe("div",Fa,"Календарей нет"))]),_:1})]),_:1}),u(Ct,{modelValue:t.showDialog,"onUpdate:modelValue":e[6]||(e[6]=i=>t.showDialog=i),"min-width":"636","max-width":"800"},{default:f(()=>[u(s,{onCloseDialog:e[3]||(e[3]=i=>t.showDialog=!1),calendar:t.calendar,"onUpdate:calendar":e[4]||(e[4]=i=>t.calendar=i),onGetCalendar:e[5]||(e[5]=i=>n.$emit("getCalendar"))},null,8,["calendar"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}const qa=ae(Wa,[["render",ja]]);const Ka={props:{allEvent:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=O("month"),t=[{type:"day",text:"День"},{type:"week",text:"Неделя"},{type:"month",text:"Месяц"},{type:"modntdh",text:"Год"},{type:"modnth",text:"Расписание"}],r=E=>{a.value=E},l=H({get:()=>n.allEvent,set:E=>e("update:allEvent",E)}),s=H({get(){let E=[];return l.value.forEach(_=>{_.events.forEach(x=>{x.period==null&&new Date(x.date_end)>I.value&&(x.date_end=I.value);let N=JSON.parse(x.period);if(N!=null){let re=N.origOptions.dtstart.split("T")[1].split(":")[0]!=21&&x.allday==!1?new Date(N.origOptions.dtstart):new Date(N.origOptions.dtstart.split("T")[0]),me=new g({...N.origOptions,dtstart:new Date(re),until:"until"in N.origOptions?new Date(N.origOptions.until):I.value}).all();console.log(me,"--------------------------------actRule");let Ve=new Date(new Date(I.value).setDate(new Date(I.value).getDate()-1));me.filter(pe=>new Date(pe).getMonth()===new Date(Ve).getMonth()&&new Date(pe).getYear()===new Date(Ve).getYear()).forEach(pe=>{let Fe={rule:N.origOptions,title:x.name,color:_.cl_color,start:new Date(pe),start_event:new Date(x.date_start),end:new Date(x.date_end),id:x.id,disable:new Date(pe).setHours(0,0,0,0)==new Date(x.date_end).setHours(0,0,0,0)};E.push(Fe)})}else i(new Date(x.date_start),new Date(x.date_end)).forEach(Oe=>{let me={rule:"",title:x.name,color:_.cl_color,start:new Date(Oe),end:new Date(x.date_end),id:x.id,disable:new Date(Oe).setHours(0,0,0,0)==new Date(x.date_end).setHours(0,0,0,0)};E.push(me)})})}),E}}),i=(E,_)=>{let x=[],N=new Date(E);for(;N<=_;)x.push(new Date(N)),N.setDate(N.getDate()+1);return x},o=O([new Date]),c=O(new Date().getMonth()),v=O(new Date().getFullYear()),h=H({get(){return 8-new Date(o.value).getDay()}}),d=()=>{a.value=="month"?c.value!=0?c.value--:(c.value=11,v.value-=1):a.value=="day"?o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()-1)):o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()-h.value))},y=()=>{a.value=="month"?c.value<11?c.value++:(c.value=0,v.value+=1):a.value=="day"?o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()+1)):o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()+h.value))},p=()=>{c.value=new Date().getMonth(),v.value=new Date().getFullYear(),o.value=new Date},T=E=>{const _=new Date;return _.setMonth(E-1),_.toLocaleString("ru",{month:"long"})},S=E=>{e("getEvent",E.id)},b=E=>new Date(E).setHours(0,0,0,0),C=(E,_)=>{if(E.rule.freq==3){if(b(_.date)!=b(E.start_event)&&b(_.date)!=b(E.end))return"rounded-sm";if(b(_.date)==b(E.start_event)&&b(_.date)==b(E.end))return"";if(b(_.date)!=b(E.start_event))return"rounded-s-lg";if(b(_.date)==b(E.start_event))return"rounded-e-lg"}if(E.rule.freq==2){let x=E.rule.byweekday[0].weekday==6?0:E.rule.byweekday[0].weekday+1,N=E.rule.byweekday[E.rule.byweekday.length-1].weekday==6?0:E.rule.byweekday[E.rule.byweekday.length-1].weekday+1;return _.date.getDay()==x&&x!=N?"rounded-e-lg":_.date.getDay()==N&&x!=N?"rounded-s-lg":_.date.getDay()!=x&&_.date.getDay()!=N?"rounded-sm":"rounded-lg"}if(E.rule.freq==0)return console.log(E,"ev"),b(_.date)==b(E.start_event)?"rounded-e-lg":"rounded-sm"},I=H({get(){return new Date(v.value,c.value+1,1)}});return{type:a,types:t,switchCalendar:r,monthNow:c,YearNow:v,returnDate:d,getMonthName:T,propsAllEvent:l,whatDay:S,nextDay:y,todayDay:p,selectDay:o,returnPeriod:s,funRoundet:C,dayNextMonth:I}}},Ba={class:"text-capitalize"};function Ga(n,e,a,t,r,l){const s=G("v-calendar");return L(),z(tt,{locale:"ru"},{default:f(()=>[u(s,{ref:"calendar",events:t.returnPeriod,"view-mode":t.type,month:t.monthNow,year:t.YearNow,"model-value":t.selectDay,class:"h-100"},{header:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(k,{class:"flex-grow-0",lg:"2"},{default:f(()=>[u(ne,{class:"text-subtitle-1",variant:"outlined",onClick:t.todayDay},{default:f(()=>[W(" Сегодня ")]),_:1},8,["onClick"]),u(ne,{icon:"mdi-menu-left",variant:"text",onClick:t.returnDate},null,8,["onClick"]),u(ne,{icon:"mdi-menu-right",variant:"text",onClick:t.nextDay},null,8,["onClick"])]),_:1}),u(k,{class:"text-h6 align-self-center ml-n6"},{default:f(()=>[ce("span",Ba,Z(t.getMonthName(t.monthNow+1)),1),W(" "+Z(t.YearNow)+" г. ",1)]),_:1}),u(k,{class:"text-end align-self-center"},{default:f(()=>[(L(!0),fe(be,null,Re(t.types,i=>(L(),z(ne,{key:i,active:t.type!=null&&t.type==i.type,variant:"text",onClick:o=>t.switchCalendar(i.type),class:"text-subtitle-1",color:t.type!=null&&t.type==i.type?"btn_text":"text_grey"},{default:f(()=>[W(Z(i.text),1)]),_:2},1032,["active","onClick","color"]))),128))]),_:1})]),_:1})]),_:1})]),event:f(({day:i,event:o})=>[tn(u(et,{class:Le(["w-100",t.funRoundet(o,i)]),density:"compact",color:o.color,onClick:c=>t.whatDay(o)},{default:f(()=>[W(Z(o.title),1)]),_:2},1032,["class","color","onClick"]),[[nn,!o.disable&&new Date(i.date).setHours(0,0,0,0)!=new Date(o.end).setHours(0,0,0,0)||o.disable&&new Date(i.date).setHours(0,0,0,0)==new Date(o.end).setHours(0,0,0,0)]])]),_:1},8,["events","view-mode","month","year","model-value"])]),_:1})}const Za=ae(Ka,[["render",Ga]]);const Ja={components:{EventCreate:Aa,CalendarMy:qa,CalendarFull:Za},setup(n,{emit:e}){const a=Ie(),t=O(!1),r=yn(),l=O(!1),s=O(null),i=O(new Date),o=O(i.value.getFullYear()),c=O(i.value.getMonth()+1),v=O([]),h=O({}),d=O(null),y=_=>{c.value=_+1},p=_=>{o.value=_},T=()=>{ue.get("api/calendar_of_events/my_calendars/").then(_=>{_.data.forEach(x=>x.visible=!a.calendar.includes(x.id)),v.value=_.data})};T();const S=(_,x)=>{ue.get(`api/calendar_of_events/my_events/${_===void 0?"":`?id=${_}`}`).then(N=>{_===void 0&&(N.data.event={name:"",participant:[a.user.is_idEmployee],files:[],date_start:new Date,date_end:new Date,period:null,description:"",calendar:null}),h.value=N.data,x&&(t.value=!0)})};S();const b=_=>{S(_,!0),_&&T()},C=()=>{s.value.$el.querySelectorAll(".v-date-picker-month__day").forEach(_=>{let x=_.getAttribute("data-v-date"),N=new Date(x).getDay()===6||new Date(x).getDay()===0;N&&_.querySelectorAll("span").forEach(re=>{re.classList.add("text-red")}),c.value in r.week[o.value]&&r.week[o.value][c.value].includes(x)&&_.querySelectorAll("span").forEach(re=>{re.classList.add("text-red"),re.classList.contains("text-red")&&N&&re.classList.replace("text-red","text-black")})})};return an(()=>{r.getWeekend(o.value)}),rn(()=>r.week,(_,x)=>{_&&C()}),{drawer_right:l,selectdate:i,cal:s,getMonth:y,getYear:p,weekendsData:C,week:r,CheckingStore:()=>{o.value in r.week?C():r.getWeekend(o.value)},showDialog:t,calendarForMy:v,accountStore:a,getCalendar:T,eventFromCalendar:h,createEvent:b,infoEvent:_=>{console.log(_,"iiiiiiiiii")},createEvents:d}}};function Xa(n,e,a,t,r,l){const s=G("calendar-my"),i=G("calendar-full"),o=G("event-create");return L(),z(P,{"no-gutters":""},{default:f(()=>[u(k,{class:"flex-grow-0 d-flex flex-column"},{default:f(()=>[u(xt,{class:"h-100 rounded-0 d-flex flex-colmn",width:"250"},{default:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"flex-grow-0 px-2 pt-1"},{default:f(()=>[u(Ut,{density:"compact",clearable:"","append-inner-icon":"mdi-magnify","hide-details":"",class:"py-3",label:"Найти событие",rows:"1","no-resize":"",variant:"outlined"})]),_:1}),u(k,{class:"flex-grow-0 px-2"},{default:f(()=>[u(ne,{type:"submit",class:"text-subtitle-1 font-weight-light",color:"btn_text",block:"",elevation:"1",onClick:e[0]||(e[0]=c=>t.createEvent())},{default:f(()=>[W("Создать событие")]),_:1})]),_:1}),u(k,{class:"w100",lg:"3"},{default:f(()=>[u(tt,{locale:"ru"},{default:f(()=>[u(Ot,{ref:"cal",modelValue:t.selectdate,"onUpdate:modelValue":e[1]||(e[1]=c=>t.selectdate=c),color:"btn_text",class:"rounded-0 minCal","max-width":"250","hide-header":"","show-adjacent-months":"",onClick:t.CheckingStore,"onUpdate:month":t.getMonth,"onUpdate:year":t.getYear},null,8,["modelValue","onClick","onUpdate:month","onUpdate:year"])]),_:1})]),_:1}),u(k,{class:"flex-column d-flex"},{default:f(()=>[u(P,{"no-gutters":"",class:"h-0 overflow-auto flex-column flex-nowrap"},{default:f(()=>[u(k,null,{default:f(()=>[u(s,{calendars:t.calendarForMy.filter(c=>c.author==t.accountStore.user.is_idEmployee),title:"Мои календари",onGetCalendar:t.getCalendar},null,8,["calendars","onGetCalendar"]),u(s,{calendars:t.calendarForMy.filter(c=>c.author!=t.accountStore.user.is_idEmployee),title:"Подписки"},null,8,["calendars"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(i,{allEvent:t.calendarForMy.filter(c=>c.events.length>0),onGetEvent:t.createEvent,"onUpdate:allEvent":e[2]||(e[2]=c=>t.infoEvent(c))},null,8,["allEvent","onGetEvent"])]),_:1}),u(Ct,{modelValue:t.showDialog,"onUpdate:modelValue":e[5]||(e[5]=c=>t.showDialog=c),"max-width":"700"},{default:f(()=>[u(o,{onCloseDialog:e[3]||(e[3]=c=>t.showDialog=!1),eventCalendar:t.eventFromCalendar,"onUpdate:eventCalendar":e[4]||(e[4]=c=>t.eventFromCalendar=c),onGetCalendar:t.getCalendar,ref:"createEvents"},null,8,["eventCalendar","onGetCalendar"])]),_:1},8,["modelValue"])]),_:1})}const mr=ae(Ja,[["render",Xa]]);export{mr as default}; +`)},e.prototype.clone=function(){var a=new e(!!this._cache);return this._rrule.forEach(function(t){return a.rrule(t.clone())}),this._exrule.forEach(function(t){return a.exrule(t.clone())}),this._rdate.forEach(function(t){return a.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return a.exdate(new Date(t.getTime()))}),a},e}(g);function kt(n,e){if(!(n instanceof g))throw new TypeError(String(n)+" is not RRule instance");A(e.map(String),String(n))||e.push(n)}function Dt(n,e){if(!(n instanceof Date))throw new TypeError(String(n)+" is not Date instance");A(e.map(Number),Number(n))||(e.push(n),Ae(e))}function Et(n,e,a){var t=!a||a.toUpperCase()==="UTC",r=t?"".concat(n,":"):"".concat(n,";TZID=").concat(a,":"),l=e.map(function(s){return nt(s.valueOf(),t)}).join(",");return"".concat(r).concat(l)}const Ya={components:{calendarCreateSelect:Yt,DialogCreate:Mt,TimeSelect:kn,UploadingFile:Tn,ReminderEvent:On,PeriodEvents:Yn},props:{eventCalendar:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=O(null),t=H({get:()=>n.eventCalendar,set:w=>e("update:eventCalendar",w)}),r=[{type:"Не повторять",rule:{},id:1},{type:"Каждый день",rule:{freq:3},id:2},{type:"Каждую неделю",rule:{freq:2},id:3},{type:"Каждый месяц",rule:{freq:1},id:4},{type:"Каждый год",rule:{freq:0},id:5}],l=H({get(){let w="";if(t.value.event.period!=null){let D=JSON.parse(t.value.event.period);D!=null&&(s(D.origOptions),r.findIndex(U=>U.rule.freq==D.origOptions.freq),w=r[r.findIndex(U=>U.rule.freq==D.origOptions.freq)])}else w=r[0].type;return E(),w},set(w){s(w.rule)}}),s=w=>{let D;w.freq==3&&(D=new g({...w,dtstart:new Date(t.value.event.date_start),until:new Date(t.value.event.date_end)})),w.freq==2&&(D=new g({...w,dtstart:new Date(t.value.event.date_start),byweekday:Oe()})),w.freq==1&&(D=new g({...w,bymonthday:me(),dtstart:new Date(t.value.event.date_start)})),w.freq==0&&(D=new g({...w,bymonthday:Ve(),dtstart:new Date(t.value.event.date_start),bymonth:pe()})),Object.keys(w).length==0?t.value.event.period=null:t.value.event.period=JSON.stringify(D)},i=[g.SU,g.MO,g.TU,g.WE,g.TH,g.FR,g.SA],o=St().alert,c=w=>!!w||"Поле обязательно",v={name:[w=>c(w)]},h=O([]);ue.get("api/calendar_of_events/get_employees/").then(w=>{h.value=w.data.filter(D=>D.employees.length>0)});const d=Ie(),y=H({get(){let w=[],D=t.value.mycalendars.findIndex(U=>U.id==b.value[0].id);return h.value.forEach(U=>{let R={...U};R.employees=U.employees.filter(V=>((V.id==d.user.is_idEmployee||t.value.event.participant.some(oe=>V.id==oe))&&(V.selected=!0),t.value.mycalendars[D].participant.some(oe=>oe.id===V.id))),R.employees.length>0&&w.push(R)}),w}}),p=w=>{ue.delete(`api/calendar_of_events/my_events/?delid=${w}`).then(D=>{o.alert=!0,o.text=D.data.mess,o.ico="mdi-check",o.color="orange-accent-1",e("getCalendar")}),e("closeDialog")},T=O([]),S=w=>{T.value=w},b=H({get(){let w=[];if(t.value.event.calendar){let D=t.value.mycalendars.findIndex(U=>U.id==t.value.event.calendar);w.push({cl_name:t.value.mycalendars[D].cl_name,cl_color:t.value.mycalendars[D].cl_color,id:t.value.mycalendars[D].id})}else w.push({cl_name:t.value.mycalendars[0].cl_name,cl_color:t.value.mycalendars[0].cl_color,id:t.value.mycalendars[0].id});return t.value.event.calendar==null&&(t.value.event.calendar=t.value.mycalendars[0].id),w},set(w){t.value.event.calendar=w.value}}),C=O(""),I=O(!1),E=()=>{t.value.event.hasOwnProperty("id")?(C.value="Редактирование события",I.value=!1):(C.value="Новое событие",I.value=!0)},_=w=>{w.staff.forEach(D=>{if(D.selected==!0&&!t.value.event.participant.includes(D.id))t.value.event.participant.push(D.id);else{let U=t.value.event.participant.findIndex(R=>R==D.id);U!=-1&&t.value.event.participant.splice(U,1)}})},x=H({get(){return Tt(new Date(t.value.event.date_start))},set(w){w.split(".")}}),N=O(!1),re=w=>{if(w){let D=new FormData;D.append("event",JSON.stringify({...t.value.event})),t.value.event.files!==null&&T.value.forEach(U=>D.append("files",U)),ue.post("api/calendar_of_events/my_events/",D).then(U=>{o.alert=!0,o.text=U.data.mess,o.ico="mdi-check",o.color="green-darken-4",e("getCalendar"),e("closeDialog")})}},Oe=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getDay(),R=D.getDay();const V=[];if(w.getDay()>D.getDay()){R=6;for(let J=U;J<=R;J++)V.push(J)}if(w.getDay()!=D.getDay()&&w.getDay()>D.getDay()){U=0;for(let J=U;J<=D.getDay();J++)V.push(J)}if(w.getDay(){oe.push(i[J])}),oe},me=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getDate(),R=D.getDate();const V=[];for(let oe=U;oe<=R;oe++)V.push(oe);return console.log(V.length,"дни в месяце"),V},Ve=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=Fe(w,D),R=[];return U.forEach(V=>R.push(new Date(V).getDate())),R},pe=()=>{const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end);let U=w.getMonth(),R=D.getMonth(),V=[];return V.push(U+1),V.includes(R+1)||V.push(R+1),console.log(V,"month"),V},Fe=(w,D)=>{let U=[],R=new Date(w);for(;R<=D;)U.push(new Date(R)),R.setDate(R.getDate()+1);return U},Ht=w=>{console.log(w,"?????????????????????????????????")},Ft=w=>jt.value>=7&&w==3,jt=H({get(){const w=new Date(t.value.event.date_start),D=new Date(t.value.event.date_end),U=1e3*60*60*24,R=D.getTime()-w.getTime();return Math.round(R/U)}});return{menudate:N,titleCard:C,newEvent:I,propsEvent:t,dateEvent:x,calendar:b,staff:h,newStaff:y,returnIdParticant:_,postFiles:S,postData:re,rules:v,delEvent:p,repeatRules:r,returnPeriod:l,periodDisplayRule:Ft,what:Ht,createDialog:a,getMonthBetweenDates:me}}},La={class:"pl-2"};function Na(n,e,a,t,r,l){const s=G("calendar-create-select"),i=G("time-select"),o=G("period-events"),c=G("reminder-event"),v=G("uploading-file"),h=G("dialog-create");return L(),z(h,{title:t.titleCard,newOrOld:t.newEvent,onPostData:t.postData,onCloseDialog:e[8]||(e[8]=d=>n.$emit("closeDialog")),onDelObject:e[9]||(e[9]=d=>t.delEvent(t.propsEvent.event.id)),ref:"createDialog"},{card_text:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Название ")]),_:1}),u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Добавить название","row-height":"25",rows:"1",variant:"outlined",modelValue:t.propsEvent.event.name,"onUpdate:modelValue":e[0]||(e[0]=d=>t.propsEvent.event.name=d),rules:t.rules.name},null,8,["modelValue","rules"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Участники ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Календарь")]),_:1}),u(k,null,{default:f(()=>[u(Ne,{modelValue:t.calendar,"onUpdate:modelValue":e[1]||(e[1]=d=>t.calendar=d),items:t.propsEvent.mycalendars,label:"Выберите календарь или найдите по названию","item-title":"cl_name","item-value":"id","hide-details":"",variant:"outlined",density:"compact",class:"py-3","return-object":"",disabled:"id"in t.propsEvent.event},{selection:f(({item:d})=>[u(Be,{class:"cursor-pointer",size:"8",color:d.raw.cl_color},null,8,["color"]),ce("span",La,Z(d.title),1)]),item:f(({item:d})=>[(L(),z(ke,{key:d.title,value:d,color:"primary",onClick:te(y=>t.calendar=d,["stop"])},{prepend:f(()=>[u(Be,{class:"cursor-pointer",size:"8",color:d.raw.cl_color},null,8,["color"])]),default:f(()=>[W(" "+Z(d.title),1)]),_:2},1032,["value","onClick"]))]),_:1},8,["modelValue","items","disabled"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-top"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pt-3",lg:"2"},{default:f(()=>[W(" Дата и время ")]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(i,{rule:t.returnPeriod!=t.repeatRules[0].type?t.returnPeriod.rule.freq:-1,chek:t.propsEvent.event.allday,order:[2,1],dateEvent:String(t.propsEvent.event.date_start),limitation:String(t.propsEvent.event.date_end),"onUpdate:dateEvent":e[2]||(e[2]=d=>t.propsEvent.event.date_start=d)},null,8,["rule","chek","dateEvent","limitation"]),u(k,{class:"order-3 flex-grow-0"},{default:f(()=>[u(Se,{icon:"mdi-minus pt-4",color:"grey-darken-1"})]),_:1}),u(i,{rule:t.returnPeriod!=t.repeatRules[0].type?t.returnPeriod.rule.freq:-1,chek:t.propsEvent.event.allday,order:[4,5],dateEvent:String(t.propsEvent.event.date_end),limitation:String(t.propsEvent.event.date_start),"onUpdate:dateEvent":e[3]||(e[3]=d=>t.propsEvent.event.date_end=d)},null,8,["rule","chek","dateEvent","limitation"])]),_:1}),u(P,{"no-gutters":""},{default:f(()=>[u(o,{dateEventStart:t.propsEvent.event,"onUpdate:dateEventStart":e[4]||(e[4]=d=>t.propsEvent.event=d)},null,8,["dateEventStart"]),u(k,{lg:"7",class:"pt-2 ml-5"},{default:f(()=>[u(Ne,{modelValue:t.returnPeriod,"onUpdate:modelValue":e[5]||(e[5]=d=>t.returnPeriod=d),items:t.repeatRules,variant:"outlined",density:"compact","return-object":"","item-title":"type","item-value":"id"},{item:f(({props:d,item:y})=>[(L(),z(ke,Ee(d,{key:y.title,value:y,color:"primary",disabled:t.periodDisplayRule(y.raw.id),onClick:p=>t.returnPeriod=y.raw}),null,16,["value","disabled","onClick"]))]),_:1},8,["modelValue","items"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-top flex-grow-0"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pt-3 h-0",lg:"2"},{default:f(()=>[W(" Напоминание ")]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap flex-grow-0"},{default:f(()=>[u(c)]),_:1}),u(P,{"no-gutters":"",class:"flex-grow-0"},{default:f(()=>[u(k,null,{default:f(()=>[u(ne,{disabled:"","prepend-icon":"mdi-plus",variant:"text",class:"text-body-2 text-text_grey"},{default:f(()=>[W(" Добавить уведомление ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Файлы ")]),_:1}),u(v,{files:t.propsEvent.event.files,"onUpdate:files":e[6]||(e[6]=d=>t.propsEvent.event.files=d),onPostFiles:t.postFiles},null,8,["files","onPostFiles"])]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Дополнительное описание","row-height":"25",rows:"3",variant:"outlined",modelValue:t.propsEvent.event.description,"onUpdate:modelValue":e[7]||(e[7]=d=>t.propsEvent.event.description=d)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["title","newOrOld","onPostData"])}const Aa=ae(Ya,[["render",Na]]);const Ia={components:{calendarCreateSelect:Yt,DialogCreate:Mt},props:{calendar:{type:Object,default:{}}},setup(n,{emit:e}){const a=Ie(),t=b=>{b.staff.forEach(C=>{let I=r.value.participant.findIndex(_=>_.participant_calendar==C.id),E=r.value.participant.find(_=>_.participant_calendar==C.id);if(b.okey=="editor")E.editor=C.editor;else if(C.selected==!0)C.id!=a.user.is_idEmployee&&I==-1&&r.value.participant.push({editor:!1,participant_calendar:C.id});else{let _=r.value.participant.findIndex(x=>x.participant_calendar==C.id);_!=-1&&r.value.participant.splice(_,1)}})},r=H({get:()=>n.calendar,set:b=>e("update:calendar",b)}),l=St().alert,s={cl_name:[b=>S(b)],cl_descr:[b=>S(b)]},i=O(""),o=O(!1);(()=>{r.value.hasOwnProperty("id")?(i.value="Редактирование календаря",r.value.author!=a.user.is_idEmployee&&(o.value=!0)):(i.value="Новый календарь",o.value=!0)})();const v=b=>{b&&ue.post("api/calendar_of_events/my_calendars/",{...n.calendar,participant:r.value.participant}).then(C=>{l.alert=!0,l.text=C.data.mess,l.ico="mdi-check",l.color="green-darken-4",e("getCalendar"),e("closeDialog")})},h=O([]);ue.get("api/calendar_of_events/get_employees/").then(b=>{h.value=b.data.filter(C=>C.employees.length>0)});const d=H({get(){return h.value.forEach(b=>{r.value.participant.length>0&&b.employees.forEach(C=>{let I=r.value.participant.find(E=>E.participant_calendar===C.id);I?(C.selected=!0,C.editor=I.editor):(C.selected=!1,C.editor=!1)})}),h.value}}),y=["red","pink","deep-orange","amber","yellow","lime","light-green","green","light-blue","blue","indigo","deep-purple","purple","blue-grey","brown"],p=b=>{r.value.cl_color===b?r.value.cl_color=null:r.value.cl_color=b},T=b=>{ue.delete(`api/calendar_of_events/my_calendars/?delid=${b}`).then(C=>{l.alert=!0,l.text=C.data.mess,l.ico="mdi-check",l.color="orange-accent-1",e("getCalendar")}),e("closeDialog")},S=b=>!!b||"Поле обязательно";return{postCalendar:v,color:y,colorPik:p,returnIdParticant:t,propsCalendar:r,delCalendar:T,rules:s,titleCard:i,newCalendar:o,newStaff:d}}},Ra=ce("div",{class:"custom-tooltip"}," Участники с доступом редактирования смогут изменять поля календаря, а также редактировать и удалять события ",-1);function Va(n,e,a,t,r,l){const s=G("calendar-create-select"),i=G("dialog-create");return L(),z(i,{title:t.titleCard,newOrOld:t.newCalendar,onCloseDialog:e[2]||(e[2]=o=>n.$emit("closeDialog")),onDelObject:e[3]||(e[3]=o=>t.delCalendar(t.propsCalendar.id)),onPostData:t.postCalendar},{card_text:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey pb-5",lg:"2"},{default:f(()=>[W(" Название ")]),_:1}),u(k,null,{default:f(()=>[u(xe,{density:"compact",label:"Описание","row-height":"25",rows:"1",variant:"outlined",modelValue:t.propsCalendar.cl_name,"onUpdate:modelValue":e[0]||(e[0]=o=>t.propsCalendar.cl_name=o),rules:t.rules.cl_name},null,8,["modelValue","rules"])]),_:1})]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Цвет ")]),_:1}),(L(!0),fe(be,null,Re(t.color,(o,c)=>(L(),z(k,{key:c},{default:f(()=>[u(Be,{class:"cursor-pointer",onClick:v=>t.colorPik(o,c),size:"x-small",color:o,variant:t.propsCalendar.cl_color===null||t.propsCalendar.cl_color===o?"flat":"tonal"},null,8,["onClick","color","variant"])]),_:2},1024))),128))]),_:1}),u(P,{"no-gutters":"",class:"align-center pb-3"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Участники ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1})]),_:1})]),_:1}),u(k,{class:"d-flex flex-grow-0"},{default:f(()=>[u(xe,{density:"compact",label:"Описание","row-height":"25",rows:"4",variant:"outlined",shaped:"","no-resize":"",rules:t.rules.cl_descr,modelValue:t.propsCalendar.cl_descr,"onUpdate:modelValue":e[1]||(e[1]=o=>t.propsCalendar.cl_descr=o)},null,8,["rules","modelValue"])]),_:1}),u(P,{"no-gutters":"",class:"align-center"},{default:f(()=>[u(k,{class:"text-body-2 text-text_grey",lg:"2"},{default:f(()=>[W(" Редакторы ")]),_:1}),u(k,null,{default:f(()=>[u(s,{staff:t.newStaff,okey:"editor",onReturnIdParticant:t.returnIdParticant},null,8,["staff","onReturnIdParticant"])]),_:1}),u(k,{lg:"1",class:"text-center"},{default:f(()=>[u($t,{location:"top"},{activator:f(({props:o})=>[u(Se,Ee(o,{icon:"mdi-help-circle-outline"}),null,16)]),default:f(()=>[Ra]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["title","newOrOld","onPostData"])}const Pa=ae(Ia,[["render",Va]]);const Wa={components:{calendarCreate:Pa},props:{calendars:{type:Array,default:()=>[]},title:{typr:String,default:""}},setup(n,{emit:e}){const a=O(!1),t=Ie(),r=O({}),l=O([0]),s=O(!1),i=O(0);return{showDialog:a,calendar:r,editCreatedCalendar:v=>{v===void 0?r.value={cl_name:"",participant:[{editor:!0,participant_calendar:t.user.is_idEmployee}],cl_color:"red",cl_descr:""}:r.value=v,a.value=!0},chekUpdate:v=>{let h=new Set(t.calendar);v.visible==!1?h.add(v.id):h.delete(v.id),t.calendar=Array.from(h)},accountStore:t,openGroup:l,trans:s,hover:i}}},za={class:"text-subtitle-2"},Ha={class:"text-body-2"},Fa={key:1,class:"text-caption text-grey text-center"};function ja(n,e,a,t,r,l){const s=G("calendar-create");return L(),z(fn,{class:"calendar",variant:"accordion",flat:"",tile:"",static:"",modelValue:t.openGroup,"onUpdate:modelValue":e[7]||(e[7]=i=>t.openGroup=i)},{default:f(()=>[u(cn,{elevation:"0",flat:"",tile:"",static:""},{default:f(()=>[u(dn,{flat:"",tile:"",static:"",class:"py-0 px-3"},{default:f(()=>[ce("div",{onClick:e[0]||(e[0]=te(()=>{},["stop"]))},[ce("span",za,Z(a.title),1)]),a.title=="Мои календари"?(L(),z(ne,{key:0,size:"x-small",icon:"mdi-plus",variant:"text",class:"pa-0",onClick:e[1]||(e[1]=te(i=>t.editCreatedCalendar(),["stop"]))})):De("",!0)]),_:1}),u(un,{flat:"",tile:"",static:""},{default:f(()=>[Object.keys(a.calendars).length>0?(L(!0),fe(be,{key:0},Re(a.calendars,(i,o)=>(L(),z(ke,{key:o,value:i.cl_name,onMouseenter:c=>t.hover=o,onMouseleave:e[2]||(e[2]=c=>t.hover=null),class:Le([{trasitlist:t.hover===o},"pa-0 cursor-default"])},{prepend:f(()=>[u(Me,{class:Le(["text-caption",`text-${i.cl_color}`]),modelValue:i.visible,"onUpdate:modelValue":[c=>i.visible=c,c=>t.chekUpdate(i)],color:i.cl_color},null,8,["class","modelValue","onUpdate:modelValue","color"])]),title:f(()=>[ce("span",Ha,Z(i.cl_name),1)]),append:f(()=>[u(en,{name:"fade"},{default:f(()=>[i.author==t.accountStore.user.is_idEmployee||i.participant.some(c=>c.editor==!0&&c.participant_calendar==t.accountStore.user.is_idEmployee)?(L(),z(ne,{key:0,size:"x-small",icon:"mdi-pen",variant:"text",class:"transitbtn",onClick:te(c=>t.editCreatedCalendar(i),["stop"])},null,8,["onClick"])):De("",!0)]),_:2},1024)]),_:2},1032,["value","onMouseenter","class"]))),128)):(L(),fe("div",Fa,"Календарей нет"))]),_:1})]),_:1}),u(Ct,{modelValue:t.showDialog,"onUpdate:modelValue":e[6]||(e[6]=i=>t.showDialog=i),"min-width":"636","max-width":"800"},{default:f(()=>[u(s,{onCloseDialog:e[3]||(e[3]=i=>t.showDialog=!1),calendar:t.calendar,"onUpdate:calendar":e[4]||(e[4]=i=>t.calendar=i),onGetCalendar:e[5]||(e[5]=i=>n.$emit("getCalendar"))},null,8,["calendar"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}const qa=ae(Wa,[["render",ja]]);const Ka={props:{allEvent:{type:Object,default:()=>{}}},setup(n,{emit:e}){const a=O("month"),t=[{type:"day",text:"День"},{type:"week",text:"Неделя"},{type:"month",text:"Месяц"},{type:"modntdh",text:"Год"},{type:"modnth",text:"Расписание"}],r=E=>{a.value=E},l=H({get:()=>n.allEvent,set:E=>e("update:allEvent",E)}),s=H({get(){let E=[];return l.value.forEach(_=>{_.events.forEach(x=>{x.period==null&&new Date(x.date_end)>I.value&&(x.date_end=I.value);let N=JSON.parse(x.period);if(N!=null){let re=N.origOptions.dtstart.split("T")[1].split(":")[0]!=21&&x.allday==!1?new Date(N.origOptions.dtstart):new Date(N.origOptions.dtstart.split("T")[0]),me=new g({...N.origOptions,dtstart:new Date(re),until:"until"in N.origOptions?new Date(N.origOptions.until):I.value}).all();console.log(me,"--------------------------------actRule");let Ve=new Date(new Date(I.value).setDate(new Date(I.value).getDate()-1));me.filter(pe=>new Date(pe).getMonth()===new Date(Ve).getMonth()&&new Date(pe).getYear()===new Date(Ve).getYear()).forEach(pe=>{let Fe={rule:N.origOptions,title:x.name,color:_.cl_color,start:new Date(pe),start_event:new Date(x.date_start),end:new Date(x.date_end),id:x.id,disable:new Date(pe).setHours(0,0,0,0)==new Date(x.date_end).setHours(0,0,0,0)};E.push(Fe)})}else i(new Date(x.date_start),new Date(x.date_end)).forEach(Oe=>{let me={rule:"",title:x.name,color:_.cl_color,start:new Date(Oe),end:new Date(x.date_end),id:x.id,disable:new Date(Oe).setHours(0,0,0,0)==new Date(x.date_end).setHours(0,0,0,0)};E.push(me)})})}),E}}),i=(E,_)=>{let x=[],N=new Date(E);for(;N<=_;)x.push(new Date(N)),N.setDate(N.getDate()+1);return x},o=O([new Date]),c=O(new Date().getMonth()),v=O(new Date().getFullYear()),h=H({get(){return 8-new Date(o.value).getDay()}}),d=()=>{a.value=="month"?c.value!=0?c.value--:(c.value=11,v.value-=1):a.value=="day"?o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()-1)):o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()-h.value))},y=()=>{a.value=="month"?c.value<11?c.value++:(c.value=0,v.value+=1):a.value=="day"?o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()+1)):o.value=new Date(new Date(o.value).setDate(new Date(o.value).getDate()+h.value))},p=()=>{c.value=new Date().getMonth(),v.value=new Date().getFullYear(),o.value=new Date},T=E=>{const _=new Date;return _.setMonth(E-1),_.toLocaleString("ru",{month:"long"})},S=E=>{e("getEvent",E.id)},b=E=>new Date(E).setHours(0,0,0,0),C=(E,_)=>{if(E.rule.freq==3){if(b(_.date)!=b(E.start_event)&&b(_.date)!=b(E.end))return"rounded-sm";if(b(_.date)==b(E.start_event)&&b(_.date)==b(E.end))return"";if(b(_.date)!=b(E.start_event))return"rounded-s-lg";if(b(_.date)==b(E.start_event))return"rounded-e-lg"}if(E.rule.freq==2){let x=E.rule.byweekday[0].weekday==6?0:E.rule.byweekday[0].weekday+1,N=E.rule.byweekday[E.rule.byweekday.length-1].weekday==6?0:E.rule.byweekday[E.rule.byweekday.length-1].weekday+1;return _.date.getDay()==x&&x!=N?"rounded-e-lg":_.date.getDay()==N&&x!=N?"rounded-s-lg":_.date.getDay()!=x&&_.date.getDay()!=N?"rounded-sm":"rounded-lg"}if(E.rule.freq==0)return console.log(E,"ev"),b(_.date)==b(E.start_event)?"rounded-e-lg":"rounded-sm"},I=H({get(){return new Date(v.value,c.value+1,1)}});return{type:a,types:t,switchCalendar:r,monthNow:c,YearNow:v,returnDate:d,getMonthName:T,propsAllEvent:l,whatDay:S,nextDay:y,todayDay:p,selectDay:o,returnPeriod:s,funRoundet:C,dayNextMonth:I}}},Ba={class:"text-capitalize"};function Ga(n,e,a,t,r,l){const s=G("v-calendar");return L(),z(tt,{locale:"ru"},{default:f(()=>[u(s,{ref:"calendar",events:t.returnPeriod,"view-mode":t.type,month:t.monthNow,year:t.YearNow,"model-value":t.selectDay,class:"h-100"},{header:f(()=>[u(k,{class:"d-flex flex-column"},{default:f(()=>[u(P,{"no-gutters":"",class:"gap"},{default:f(()=>[u(k,{class:"flex-grow-0",lg:"2"},{default:f(()=>[u(ne,{class:"text-subtitle-1",variant:"outlined",onClick:t.todayDay},{default:f(()=>[W(" Сегодня ")]),_:1},8,["onClick"]),u(ne,{icon:"mdi-menu-left",variant:"text",onClick:t.returnDate},null,8,["onClick"]),u(ne,{icon:"mdi-menu-right",variant:"text",onClick:t.nextDay},null,8,["onClick"])]),_:1}),u(k,{class:"text-h6 align-self-center ml-n6"},{default:f(()=>[ce("span",Ba,Z(t.getMonthName(t.monthNow+1)),1),W(" "+Z(t.YearNow)+" г. ",1)]),_:1}),u(k,{class:"text-end align-self-center"},{default:f(()=>[(L(!0),fe(be,null,Re(t.types,i=>(L(),z(ne,{key:i,active:t.type!=null&&t.type==i.type,variant:"text",onClick:o=>t.switchCalendar(i.type),class:"text-subtitle-1",color:t.type!=null&&t.type==i.type?"btn_text":"text_grey"},{default:f(()=>[W(Z(i.text),1)]),_:2},1032,["active","onClick","color"]))),128))]),_:1})]),_:1})]),_:1})]),event:f(({day:i,event:o})=>[tn(u(et,{class:Le(["w-100",t.funRoundet(o,i)]),density:"compact",color:o.color,onClick:c=>t.whatDay(o)},{default:f(()=>[W(Z(o.title),1)]),_:2},1032,["class","color","onClick"]),[[nn,!o.disable&&new Date(i.date).setHours(0,0,0,0)!=new Date(o.end).setHours(0,0,0,0)||o.disable&&new Date(i.date).setHours(0,0,0,0)==new Date(o.end).setHours(0,0,0,0)]])]),_:1},8,["events","view-mode","month","year","model-value"])]),_:1})}const Za=ae(Ka,[["render",Ga]]);const Ja={components:{EventCreate:Aa,CalendarMy:qa,CalendarFull:Za},setup(n,{emit:e}){const a=Ie(),t=O(!1),r=yn(),l=O(!1),s=O(null),i=O(new Date),o=O(i.value.getFullYear()),c=O(i.value.getMonth()+1),v=O([]),h=O({}),d=O(null),y=_=>{c.value=_+1},p=_=>{o.value=_},T=()=>{ue.get("api/calendar_of_events/my_calendars/").then(_=>{_.data.forEach(x=>x.visible=!a.calendar.includes(x.id)),v.value=_.data})};T();const S=(_,x)=>{ue.get(`api/calendar_of_events/my_events/${_===void 0?"":`?id=${_}`}`).then(N=>{_===void 0&&(N.data.event={name:"",participant:[a.user.is_idEmployee],files:[],date_start:new Date,date_end:new Date,period:null,description:"",calendar:null}),h.value=N.data,x&&(t.value=!0)})};S();const b=_=>{S(_,!0),_&&T()},C=()=>{s.value.$el.querySelectorAll(".v-date-picker-month__day").forEach(_=>{let x=_.getAttribute("data-v-date"),N=new Date(x).getDay()===6||new Date(x).getDay()===0;N&&_.querySelectorAll("span").forEach(re=>{re.classList.add("text-red")}),c.value in r.week[o.value]&&r.week[o.value][c.value].includes(x)&&_.querySelectorAll("span").forEach(re=>{re.classList.add("text-red"),re.classList.contains("text-red")&&N&&re.classList.replace("text-red","text-black")})})};return an(()=>{r.getWeekend(o.value)}),rn(()=>r.week,(_,x)=>{_&&C()}),{drawer_right:l,selectdate:i,cal:s,getMonth:y,getYear:p,weekendsData:C,week:r,CheckingStore:()=>{o.value in r.week?C():r.getWeekend(o.value)},showDialog:t,calendarForMy:v,accountStore:a,getCalendar:T,eventFromCalendar:h,createEvent:b,infoEvent:_=>{console.log(_,"iiiiiiiiii")},createEvents:d}}};function Xa(n,e,a,t,r,l){const s=G("calendar-my"),i=G("calendar-full"),o=G("event-create");return L(),z(P,{"no-gutters":""},{default:f(()=>[u(k,{class:"flex-grow-0 d-flex flex-column"},{default:f(()=>[u(xt,{class:"h-100 rounded-0 d-flex flex-colmn",width:"250"},{default:f(()=>[u(P,{"no-gutters":"",class:"flex-column"},{default:f(()=>[u(k,{class:"flex-grow-0 px-2 pt-1"},{default:f(()=>[u(Ut,{density:"compact",clearable:"","append-inner-icon":"mdi-magnify","hide-details":"",class:"py-3",label:"Найти событие",rows:"1","no-resize":"",variant:"outlined"})]),_:1}),u(k,{class:"flex-grow-0 px-2"},{default:f(()=>[u(ne,{type:"submit",class:"text-subtitle-1 font-weight-light",color:"btn_text",block:"",elevation:"1",onClick:e[0]||(e[0]=c=>t.createEvent())},{default:f(()=>[W("Создать событие")]),_:1})]),_:1}),u(k,{class:"w100",lg:"3"},{default:f(()=>[u(tt,{locale:"ru"},{default:f(()=>[u(Ot,{ref:"cal",modelValue:t.selectdate,"onUpdate:modelValue":e[1]||(e[1]=c=>t.selectdate=c),color:"btn_text",class:"rounded-0 minCal","max-width":"250","hide-header":"","show-adjacent-months":"",onClick:t.CheckingStore,"onUpdate:month":t.getMonth,"onUpdate:year":t.getYear},null,8,["modelValue","onClick","onUpdate:month","onUpdate:year"])]),_:1})]),_:1}),u(k,{class:"flex-column d-flex"},{default:f(()=>[u(P,{"no-gutters":"",class:"h-0 overflow-auto flex-column flex-nowrap"},{default:f(()=>[u(k,null,{default:f(()=>[u(s,{calendars:t.calendarForMy.filter(c=>c.author==t.accountStore.user.is_idEmployee),title:"Мои календари",onGetCalendar:t.getCalendar},null,8,["calendars","onGetCalendar"]),u(s,{calendars:t.calendarForMy.filter(c=>c.author!=t.accountStore.user.is_idEmployee),title:"Подписки"},null,8,["calendars"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(k,{class:"d-flex flex-column"},{default:f(()=>[u(i,{allEvent:t.calendarForMy.filter(c=>c.events.length>0),onGetEvent:t.createEvent,"onUpdate:allEvent":e[2]||(e[2]=c=>t.infoEvent(c))},null,8,["allEvent","onGetEvent"])]),_:1}),u(Ct,{modelValue:t.showDialog,"onUpdate:modelValue":e[5]||(e[5]=c=>t.showDialog=c),"max-width":"700"},{default:f(()=>[u(o,{onCloseDialog:e[3]||(e[3]=c=>t.showDialog=!1),eventCalendar:t.eventFromCalendar,"onUpdate:eventCalendar":e[4]||(e[4]=c=>t.eventFromCalendar=c),onGetCalendar:t.getCalendar,ref:"createEvents"},null,8,["eventCalendar","onGetCalendar"])]),_:1},8,["modelValue"])]),_:1})}const pr=ae(Ja,[["render",Xa]]);export{pr as default}; diff --git a/src/front/dist/assets/ChaptersSafety-2b672a2f.js b/src/front/dist/assets/ChaptersSafety-3fee79d6.js similarity index 95% rename from src/front/dist/assets/ChaptersSafety-2b672a2f.js rename to src/front/dist/assets/ChaptersSafety-3fee79d6.js index 84bb8b27c..24b363ce2 100644 --- a/src/front/dist/assets/ChaptersSafety-2b672a2f.js +++ b/src/front/dist/assets/ChaptersSafety-3fee79d6.js @@ -1,4 +1,4 @@ -var Ks=Object.defineProperty;var vs=(lt,r,h)=>r in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,m)=>(Xe(lt,r,"write to private field"),m?m.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,m)=>({set _(T){ul(lt,r,T,h)},get _(){return bt(lt,r,m)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{a7 as propsFactory,ab as genericComponent,af as useRender,x as createVNode,z as mergeProps,c_ as omit,c$ as IconValue,d0 as getUid,f as computed,ak as useProxiedModel,d1 as filterInputAttrs,S as Fragment,r as ref,s as openBlock,R as createElementBlock,v as withCtx,E as VCol,K as VCard,T as renderList,F as VCardActions,t as createBlock,y as createTextVNode,A as VBtn,a0 as createCommentVNode,D as VRow,M as createBaseVNode,$ as toDisplayString,cP as getAugmentedNamespace$1,ah as shallowRef,ao as watchEffect,e as onBeforeUnmount,bk as defineComponent,ck as toValue,an as toRef,w as watch,c3 as renderSlot,bO as normalizeStyle,cQ as commonjsGlobal$1,Q as resolveComponent,u as unref,X as VImg,L as VDialog,U as axiosApiInstance,cT as VCardSubtitle,a5 as baseURL,_ as _export_sfc,d2 as get_name,B as VCardTitle,aP as normalizeClass,I as VProgressLinear,G as withDirectives,H as vShow,C as VCardText,Z as VDivider,d3 as spravURLBase,a3 as VListItem,V as VIcon,cV as pagecounter,cN as useRoute,bX as onUpdated}from"./index-84cc8e63.js";import{P as PatternTabs}from"./PatternTabs-42032570.js";import{V as VWindow,a as VWindowItem}from"./VWindowItem-bd3460f3.js";import{V as VSpacer}from"./VSpacer-bea6911b.js";import{V as VContainer}from"./VContainer-508c7a47.js";import{m as makeVInputProps,V as VInput,a as VLabel}from"./VInput-e5a7e0e7.js";import{m as makeVSelectionControlProps,V as VSelectionControl,a as makeSelectionControlGroupProps,b as VSelectionControlGroup}from"./VSelectionControl-b8db7e28.js";import{V as VCheckbox}from"./VCheckbox-2f558c7e.js";import{V as VExpansionPanels,a as VExpansionPanel,b as VExpansionPanelTitle,c as VExpansionPanelText}from"./VExpansionPanels-50a2ee63.js";import{V as VList}from"./VList-d0850642.js";import"./ssrBoot-04c9ae84.js";import"./VCheckboxBtn-c07777d8.js";const makeVRadioProps=propsFactory({...makeVSelectionControlProps({falseIcon:"$radioOff",trueIcon:"$radioOn"})},"VRadio"),VRadio=genericComponent()({name:"VRadio",props:makeVRadioProps(),setup(lt,r){let{slots:h}=r;return useRender(()=>createVNode(VSelectionControl,mergeProps(lt,{class:["v-radio",lt.class],style:lt.style,type:"radio"}),h)),{}}}),VRadioGroup$1="",makeVRadioGroupProps=propsFactory({height:{type:[Number,String],default:"auto"},...makeVInputProps(),...omit(makeSelectionControlGroupProps(),["multiple"]),trueIcon:{type:IconValue,default:"$radioOn"},falseIcon:{type:IconValue,default:"$radioOff"},type:{type:String,default:"radio"}},"VRadioGroup"),VRadioGroup=genericComponent()({name:"VRadioGroup",inheritAttrs:!1,props:makeVRadioGroupProps(),emits:{"update:modelValue":lt=>!0},setup(lt,r){let{attrs:h,slots:m}=r;const T=getUid(),B=computed(()=>lt.id||`radio-group-${T}`),v=useProxiedModel(lt,"modelValue");return useRender(()=>{const[F,J]=filterInputAttrs(h),p=VInput.filterProps(lt),S=VSelectionControl.filterProps(lt),_=m.label?m.label({label:lt.label,props:{for:B.value}}):lt.label;return createVNode(VInput,mergeProps({class:["v-radio-group",lt.class],style:lt.style},F,p,{modelValue:v.value,"onUpdate:modelValue":U=>v.value=U,id:B.value}),{...m,default:U=>{let{id:f,messagesId:L,isDisabled:g,isReadonly:I}=U;return createVNode(Fragment,null,[_&&createVNode(VLabel,{id:f.value},{default:()=>[_]}),createVNode(VSelectionControlGroup,mergeProps(S,{id:f.value,"aria-describedby":L.value,defaultsTarget:"VRadio",trueIcon:lt.trueIcon,falseIcon:lt.falseIcon,type:lt.type,disabled:g.value,readonly:I.value,"aria-labelledby":_?f.value:void 0,multiple:!1},J,{modelValue:v.value,"onUpdate:modelValue":C=>v.value=C}),m)])}})}),{}}}),_sfc_main$4={__name:"TestSafety",props:{data:Array},setup(lt){const r=ref([{question:"Вопрос 1",answers:["1","2","3","4"]},{question:"Вопрос 2",answers:["Rer","LoL","Fort","FullG"]},{checkQuestion:"Вопрос с чексбоксом",answers:["Кукумбер","Сикельд"]}]),h=ref(""),m=ref([]),T=ref([]),B=ref(0);return(v,F)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(VRow,null,{default:withCtx(()=>[createVNode(VCol,{cols:"12"},{default:withCtx(()=>[createVNode(VCard,null,{default:withCtx(()=>[createVNode(VWindow,{modelValue:B.value,"onUpdate:modelValue":F[2]||(F[2]=J=>B.value=J)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(J,p)=>(openBlock(),createBlock(VWindowItem,{key:p},{default:withCtx(()=>[J.question?(openBlock(),createBlock(VCard,{key:0,title:J.question},{default:withCtx(()=>[createVNode(VRadioGroup,{modelValue:h.value,"onUpdate:modelValue":F[0]||(F[0]=S=>h.value=S),label:"Выберите вариант ответа"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(J.answers,S=>(openBlock(),createBlock(VRadio,{label:S,value:S},null,8,["label","value"]))),256))]),_:2},1032,["modelValue"])]),_:2},1032,["title"])):createCommentVNode("",!0),J.checkQuestion?(openBlock(),createBlock(VCard,{key:1,title:J.checkQuestion},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(J.answers,S=>(openBlock(),createBlock(VCheckbox,{modelValue:m.value,"onUpdate:modelValue":F[1]||(F[1]=_=>m.value=_),label:S,value:S},null,8,["modelValue","label","value"]))),256))]),_:2},1032,["title"])):createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["modelValue"]),createVNode(VCardActions,null,{default:withCtx(()=>[B.value>0?(openBlock(),createBlock(VBtn,{key:0,variant:"text",onClick:F[3]||(F[3]=J=>B.value--)},{default:withCtx(()=>[createTextVNode(" Back ")]),_:1})):createCommentVNode("",!0),createVNode(VSpacer),B.valueB.value++)},{default:withCtx(()=>[createTextVNode(" Next ")]),_:1})):createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(VRow,null,{default:withCtx(()=>[createVNode(VCol,null,{default:withCtx(()=>[createVNode(VCard,{title:"Результат"},{default:withCtx(()=>[createVNode(VContainer,null,{default:withCtx(()=>[createBaseVNode("p",null,"Количество баллов: "+toDisplayString(T.value),1)]),_:1})]),_:1})]),_:1})]),_:1})],64))}};function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Ll;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=al,r.getUuid=Vl,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=jt,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=Yl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=Yt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const m=[1,0,0,1,0,0];r.IDENTITY_MATRIX=m;const T=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=T;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const v=1.35;r.LINE_FACTOR=v;const F=.35;r.LINE_DESCENT_FACTOR=F;const J=F/v;r.BASELINE_FACTOR=J;const p={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=p;const S={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=S;const _="pdfjs_internal_editor_";r.AnnotationEditorPrefix=_;const U={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=U;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const L={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=L;const g={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=g;const I={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=I;const C={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=C;const j={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=j;const K={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=K;const P={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=P;const M={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=M;const u={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=u;const q={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=q;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const H={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=H;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const at={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=at;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=H.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=H.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=H.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Lt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const Ct=_t.match(/\./g);(Ct==null?void 0:Ct.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Lt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const dt=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=dt;class w extends dt{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=w;class k extends dt{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=k;class X extends dt{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class O extends dt{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=O;class Q extends dt{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=Q;class st extends dt{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends dt{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],Ct=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,Ct]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],Ct=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[Ct,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),Ct=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Vt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],Ct[0],Ot[0],Vt[0]),Math.min(Tt[1],Ct[1],Ot[1],Vt[1]),Math.max(Tt[0],Ct[0],Ot[0],Vt[0]),Math.max(Tt[1],Ct[1],Ot[1],Vt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],Ct=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Vt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Vt)/2,Kt=Math.sqrt((Tt+Vt)**2-4*(Tt*Vt-Ot*Ct))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),Ct=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>Ct)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Vt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Vt?null:[Tt,Ot,Ct,Vt]}static bezierBoundingBox(ot,ut,Tt,Ct,Ot,Vt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,rl,hl,Il,Wl,nt,R;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,rl=3*Tt-3*ot):(Qt=6*ut-12*Ct+6*Vt,ol=-3*ut+9*Ct-9*Vt+3*Kt,rl=3*Ct-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-rl/Qt,0="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),Ct=Rt(_t);return Tt.decode(Ct)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut{this.resolve=Tt=>{ul(this,Ll,!0),ot(Tt)},this.reject=Tt=>{ul(this,Ll,!0),ut(Tt)}})}get settled(){return bt(this,Ll)}}Ll=new WeakMap,r.PromiseCapability=Ml;let pl=null,Xl=null;function Yl(_t){return pl||(pl=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(pl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Vl(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,m,T,vl,v,ce,J,p,S,_,U,f,L,g,I,ae,j,K,pe,M,u;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const H=new PDFDocumentLoadingTask,{docId:Zt}=H,at=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Lt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,dt=$.CMapReaderFactory||DefaultCMapReaderFactory,w=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,k=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,O=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,Q=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:dt===_display_utils.DOMCMapReaderFactory&&k===_display_utils.DOMStandardFontDataFactory&&Ht&&w&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(w,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),Yt=null;(0,_util.setVerbosityLevel)(Ut);const jt={canvasFactory:Ft,filterFactory:wt};if(Bt||(jt.cMapReaderFactory=new dt({baseUrl:Ht,isCompressed:Pt}),jt.standardFontDataFactory=new k({baseUrl:w})),!Nt){const Ml={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=Ml.port?PDFWorker.fromPort(Ml):new PDFWorker(Ml),H._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Lt,enableXfa:gt,evaluatorOptions:{maxImageSize:O,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:Q,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?w:null}},al={ignoreErrors:X,isEvalSupported:Q,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:Yt};return Nt.promise.then(function(){if(H.destroyed)throw new Error("Loading aborted");const Ml=_fetchDocument(Nt,$t),pl=new Promise(function(Xl){let Yl;zt?Yl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(Yl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:at,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(Yl)});return Promise.all([Ml,pl]).then(function([Xl,Yl]){if(H.destroyed)throw new Error("Loading aborted");const Vl=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Vl,H,Yl,al,jt);H._transport=yl,Vl.send("Ready",null)})}).catch(H._capability.reject),H}async function _fetchDocument($,H){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",H,H.data?[H.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var H,Zt,at;this.destroyed=!0;try{(H=this._worker)!=null&&H.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(at=this._worker)!=null&&at.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(H,Zt,at=!1,It=null){this.length=H,this.initialData=Zt,this.progressiveDone=at,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(H){this._rangeListeners.push(H)}addProgressListener(H){this._progressListeners.push(H)}addProgressiveReadListener(H){this._progressiveReadListeners.push(H)}addProgressiveDoneListener(H){this._progressiveDoneListeners.push(H)}onDataRange(H,Zt){for(const at of this._rangeListeners)at(H,Zt)}onDataProgress(H,Zt){this._readyCapability.promise.then(()=>{for(const at of this._progressListeners)at(H,Zt)})}onDataProgressiveRead(H){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(H)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const H of this._progressiveDoneListeners)H()})}transportReady(){this._readyCapability.resolve()}requestDataRange(H,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(H,Zt){this._pdfInfo=H,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(at=>{if(!at)return at;const It=[];for(const xt in at)It.push(...at[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(H){return this._transport.getPage(H)}getPageIndex(H){return this._transport.getPageIndex(H)}getDestinations(){return this._transport.getDestinations()}getDestination(H){return this._transport.getDestination(H)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(H=!1){return this._transport.startCleanup(H||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(H,Zt,at,It=!1){ll(this,T);ll(this,v);ll(this,h,null);ll(this,m,!1);this._pageIndex=H,this._pageInfo=Zt,this._transport=at,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=at.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:H,rotation:Zt=this.rotate,offsetX:at=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:H,rotation:Zt,offsetX:at,offsetY:It,dontFlip:xt})}getAnnotations({intent:H="display"}={}){const Zt=this._transport.getRenderingIntent(H);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var H;return((H=this._transport._htmlForXfa)==null?void 0:H.children[this._pageIndex])||null}render({canvasContext:H,viewport:Zt,intent:at="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var k,X;(k=this._stats)==null||k.time("Overall");const Ut=this._transport.getRenderingIntent(at,It,Nt);ul(this,m,!1),nl(this,v,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Lt=this._intentStates.get(Ut.cacheKey);Lt||(Lt=Object.create(null),this._intentStates.set(Ut.cacheKey,Lt)),Lt.streamReaderCancelTimeout&&(clearTimeout(Lt.streamReaderCancelTimeout),Lt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Lt.displayReadyCapability||(Lt.displayReadyCapability=new _util.PromiseCapability,Lt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=O=>{var Q,st;Lt.renderTasks.delete(dt),(this._maybeCleanupAfterRender||Ht)&&ul(this,m,!0),nl(this,T,vl).call(this,!Ht),O?(dt.capability.reject(O),this._abortOperatorList({intentState:Lt,reason:O instanceof Error?O:new Error(O)})):dt.capability.resolve(),(Q=this._stats)==null||Q.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},dt=new InternalRenderTask({callback:Pt,params:{canvasContext:H,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Lt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Lt.renderTasks||(Lt.renderTasks=new Set)).add(dt);const w=dt.task;return Promise.all([Lt.displayReadyCapability.promise,Xt]).then(([O,Q])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),dt.initializeGraphics({transparency:O,optionalContentConfig:Q}),dt.operatorListChanged()}).catch(Pt),w}getOperatorList({intent:H="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:at=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(H,Zt,at,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:H=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:H===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(H={}){if(this._transport._htmlForXfa)return this.getXfa().then(at=>_xfa_text.XfaText.textContent(at));const Zt=this.streamTextContent(H);return new Promise(function(at,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){at(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const H=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const at of Zt.renderTasks)H.push(at.completed),at.cancel();return this.objs.clear(),ul(this,m,!1),nl(this,v,ce).call(this),Promise.all(H)}cleanup(H=!1){ul(this,m,!0);const Zt=nl(this,T,vl).call(this,!1);return H&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(H,Zt){var It,xt;const at=this._intentStates.get(Zt);at&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=at.displayReadyCapability)==null||xt.resolve(H))}_renderPageChunk(H,Zt){for(let at=0,It=H.length;at{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,T,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:H,reason:Zt,force:at=!1}){if(H.streamReader){if(H.streamReaderCancelTimeout&&(clearTimeout(H.streamReaderCancelTimeout),H.streamReaderCancelTimeout=null),!at){if(H.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),H.streamReaderCancelTimeout=setTimeout(()=>{H.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:H,reason:Zt,force:!0})},It);return}}if(H.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),H.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===H){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,m=new WeakMap,T=new WeakSet,vl=function(H=!1){if(nl(this,v,ce).call(this),!bt(this,m)||this.destroyed)return!1;if(H)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,T,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:at}of this._intentStates.values())if(Zt.size>0||!at.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,m,!1),!0},v=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,J,new Set);ll(this,p,Promise.resolve())}postMessage(H,Zt){const at={data:structuredClone(H,Zt?{transfer:Zt}:null)};bt(this,p).then(()=>{for(const It of bt(this,J))It.call(this,at)})}addEventListener(H,Zt){bt(this,J).add(Zt)}removeEventListener(H,Zt){bt(this,J).delete(Zt)}terminate(){bt(this,J).clear()}}J=new WeakMap,p=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(S=document==null?void 0:document.currentScript)==null?void 0:S.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,H){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const at=new URL(H,Zt);return Zt.origin===at.origin},PDFWorkerUtil.createCDNWrapper=function($){const H=`importScripts("${$}");`;return URL.createObjectURL(new Blob([H]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:H=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var at;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,H){if((at=bt(_PDFWorker,_))!=null&&at.has(H))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,_)||ul(_PDFWorker,_,new WeakMap)).set(H,this),this._initializeFromPort(H);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const H=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",H),at=()=>{H.removeEventListener("error",It),Zt.destroy(),H.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||at()};H.addEventListener("error",It),Zt.on("test",it=>{if(H.removeEventListener("error",It),this.destroyed){at();return}it?(this._messageHandler=Zt,this._port=H,this._webWorker=H,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),H.terminate())}),Zt.on("ready",it=>{if(H.removeEventListener("error",It),this.destroyed){at();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const H=new LoopbackPort;this._port=H;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,at=new _message_handler.MessageHandler(Zt+"_worker",Zt,H);$.setup(at,H);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",H);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,_))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const H=(Zt=bt(this,_))==null?void 0:Zt.get($.port);if(H){if(H._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return H}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};_=new WeakMap,ll(_PDFWorker,_,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(H,Zt,at,It,xt){ll(this,I);ll(this,U,new Map);ll(this,f,new Map);ll(this,L,new Map);ll(this,g,null);this.messageHandler=H,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=at,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(H,Zt=_util.AnnotationMode.ENABLE,at=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(H){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${H}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&at instanceof _annotation_storage.PrintAnnotationStorage?at:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var at;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(at=bt(this,g))==null||at.reject(new Error("Worker was destroyed during onPassword callback"));const H=[];for(const It of bt(this,f).values())H.push(It._destroy());bt(this,f).clear(),bt(this,L).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return H.push(Zt),Promise.all(H).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,U).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:H,loadingTask:Zt}=this;H.on("GetReader",(at,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),H.on("ReaderHeadersReady",at=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),H.on("GetRangeReader",(at,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(at.begin,at.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),H.on("GetDoc",({pdfInfo:at})=>{this._numPages=at.numPages,this._htmlForXfa=at.htmlForXfa,delete at.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(at,this))}),H.on("DocException",function(at){let It;switch(at.name){case"PasswordException":It=new _util.PasswordException(at.message,at.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(at.message);break;case"MissingPDFException":It=new _util.MissingPDFException(at.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(at.message,at.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(at.message,at.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),H.on("PasswordRequest",at=>{if(ul(this,g,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,g).reject(xt):bt(this,g).resolve({password:xt})};try{Zt.onPassword(It,at.code)}catch(xt){bt(this,g).reject(xt)}}else bt(this,g).reject(new _util.PasswordException(at.message,at.code));return bt(this,g).promise}),H.on("DataLoaded",at=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:at.length,total:at.length}),this.downloadInfoCapability.resolve(at)}),H.on("StartRenderPage",at=>{if(this.destroyed)return;bt(this,f).get(at.pageIndex)._startRenderPage(at.transparency,at.cacheKey)}),H.on("commonobj",([at,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(at))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(at,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>H.sendWithPromise("FontFallback",{id:at})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(at,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(at,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),H.on("obj",([at,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(at))switch(xt){case"Image":if(Xt.objs.resolve(at,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(at,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),H.on("DocProgress",at=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:at.loaded,total:at.total})}),H.on("FetchBuiltInCMap",at=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(at):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),H.on("FetchStandardFontData",at=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(at):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var at;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:H,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:H,filename:((at=this._fullReader)==null?void 0:at.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(H){if(!Number.isInteger(H)||H<=0||H>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=H-1,at=bt(this,L).get(Zt);if(at)return at;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,L).set(Zt,It),It}getPageIndex(H){return typeof H!="object"||H===null||!Number.isInteger(H.num)||H.num<0||!Number.isInteger(H.gen)||H.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:H.num,gen:H.gen})}getAnnotations(H,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:H,intent:Zt})}getFieldObjects(){return nl(this,I,ae).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,I,ae).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(H){return typeof H!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:H})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return nl(this,I,ae).call(this,"GetDocJSActions")}getPageJSActions(H){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:H})}getStructTree(H){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:H})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(H=>new _optional_content_config.OptionalContentConfig(H))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const H="GetMetadata",Zt=bt(this,U).get(H);if(Zt)return Zt;const at=this.messageHandler.sendWithPromise(H,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,U).set(H,at),at}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(H=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),H||this.fontLoader.clear(),bt(this,U).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:H,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:H,enableXfa:Zt})}}U=new WeakMap,f=new WeakMap,L=new WeakMap,g=new WeakMap,I=new WeakSet,ae=function(H,Zt=null){const at=bt(this,U).get(H);if(at)return at;const It=this.messageHandler.sendWithPromise(H,Zt);return bt(this,U).set(H,It),It};class PDFObjects{constructor(){ll(this,K);ll(this,j,Object.create(null))}get(H,Zt=null){if(Zt){const It=nl(this,K,pe).call(this,H);return It.capability.promise.then(()=>Zt(It.data)),null}const at=bt(this,j)[H];if(!(at!=null&&at.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${H}.`);return at.data}has(H){const Zt=bt(this,j)[H];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(H,Zt=null){const at=nl(this,K,pe).call(this,H);at.data=Zt,at.capability.resolve()}clear(){var H;for(const Zt in bt(this,j)){const{data:at}=bt(this,j)[Zt];(H=at==null?void 0:at.bitmap)==null||H.close()}ul(this,j,Object.create(null))}}j=new WeakMap,K=new WeakSet,pe=function(H){var Zt;return(Zt=bt(this,j))[H]||(Zt[H]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(H){ll(this,M,null);ul(this,M,H),this.onContinue=null}get promise(){return bt(this,M).capability.promise}cancel(H=0){bt(this,M).cancel(null,H)}get separateAnnots(){const{separateAnnots:H}=bt(this,M).operatorList;if(!H)return!1;const{annotationCanvasMap:Zt}=bt(this,M);return H.form||H.canvas&&(Zt==null?void 0:Zt.size)>0}}M=new WeakMap,exports.RenderTask=RenderTask;const q=class q{constructor({callback:H,params:Zt,objs:at,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Lt=null}){this.callback=H,this.params=Zt,this.objs=at,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Lt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:H=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(q,u).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bt(q,u).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:at,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(at,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:H,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(H=null,Zt=0){var at;this.running=!1,this.cancelled=!0,(at=this.gfx)==null||at.endDrawing(),bt(q,u).delete(this._canvas),this.callback(H||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var H;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(H=this.stepper)==null||H.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(q,u).delete(this._canvas),this.callback())))}};u=new WeakMap,ll(q,u,new WeakSet);let InternalRenderTask=q;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var p,S,_,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var m=h(1),T=h(4),B=h(8);const v=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=v;class F{constructor(){ll(this,_);ll(this,p,!1);ll(this,S,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(g,I){const C=bt(this,S).get(g);return C===void 0?I:Object.assign(I,C)}getRawValue(g){return bt(this,S).get(g)}remove(g){if(bt(this,S).delete(g),bt(this,S).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const I of bt(this,S).values())if(I instanceof T.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(g,I){const C=bt(this,S).get(g);let j=!1;if(C!==void 0)for(const[K,P]of Object.entries(I))C[K]!==P&&(j=!0,C[K]=P);else j=!0,bt(this,S).set(g,I);j&&nl(this,_,ss).call(this),I instanceof T.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(I.constructor._type)}has(g){return bt(this,S).has(g)}getAll(){return bt(this,S).size>0?(0,m.objectFromMap)(bt(this,S)):null}setAll(g){for(const[I,C]of Object.entries(g))this.setValue(I,C)}get size(){return bt(this,S).size}resetModified(){bt(this,p)&&(ul(this,p,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new J(this)}get serializable(){if(bt(this,S).size===0)return v;const g=new Map,I=new B.MurmurHash3_64,C=[],j=Object.create(null);let K=!1;for(const[P,M]of bt(this,S)){const u=M instanceof T.AnnotationEditor?M.serialize(!1,j):M;u&&(g.set(P,u),I.update(`${P}:${JSON.stringify(u)}`),K||(K=!!u.bitmap))}if(K)for(const P of g.values())P.bitmap&&C.push(P.bitmap);return g.size>0?{map:g,hash:I.hexdigest(),transfers:C}:v}}p=new WeakMap,S=new WeakMap,_=new WeakSet,ss=function(){bt(this,p)||(ul(this,p,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=F;class J extends F{constructor(I){super();ll(this,f,void 0);const{map:C,hash:j,transfers:K}=I.serializable,P=structuredClone(C,K?{transfer:K}:null);ul(this,f,{map:P,hash:j,transfers:K})}get print(){(0,m.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=J},(lt,r,h)=>{var J,p,S,_,U,f,L,g,I,C,j,K,P,M,u,Ye,$,ye,Zt,Te,It,Ve,it,is,zt,cs,Nt,as,Lt,Le,Pt,ds;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var m=h(5),T=h(1),B=h(6);const w=class w{constructor(X){ll(this,u);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Lt);ll(this,Pt);ll(this,J,"");ll(this,p,!1);ll(this,S,null);ll(this,_,null);ll(this,U,null);ll(this,f,!1);ll(this,L,null);ll(this,g,this.focusin.bind(this));ll(this,I,this.focusout.bind(this));ll(this,C,!1);ll(this,j,!1);ll(this,K,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,P,!1);ll(this,M,w._zIndex++);this.constructor===w&&(0,T.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:O,rawDims:{pageWidth:Q,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=O,this.pageRotation=(360+O-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[Q,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,T.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const O=new F({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});O.annotationElementId=X.annotationElementId,O.deleted=!0,O._uiManager.addToAnnotationStorage(O)}static initialize(X,O=null){if(w._l10nPromise||(w._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),O!=null&&O.strings)for(const st of O.strings)w._l10nPromise.set(st,X.get(st));if(w._borderLineWidth!==-1)return;const Q=getComputedStyle(document.documentElement);w._borderLineWidth=parseFloat(Q.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,O){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,O){(0,T.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,P)}set _isDraggable(X){var O;ul(this,P,X),(O=this.div)==null||O.classList.toggle("draggable",X)}center(){const[X,O]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*O/(X*2),this.y+=this.width*X/(O*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*O/(X*2),this.y-=this.width*X/(O*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,M)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,C)?ul(this,C,!1):this.parent.setSelected(this))}focusout(X){var Q;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const O=X.relatedTarget;O!=null&&O.closest(`#${this.id}`)||(X.preventDefault(),(Q=this.parent)!=null&&Q.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,O,Q,st){const[et,Mt]=this.parentDimensions;[Q,st]=this.screenToPageTranslation(Q,st),this.x=(X+Q)/et,this.y=(O+st)/Mt,this.fixAndSetPosition()}translate(X,O){nl(this,u,Ye).call(this,this.parentDimensions,X,O)}translateInPage(X,O){nl(this,u,Ye).call(this,this.pageDimensions,X,O),this.div.scrollIntoView({block:"nearest"})}drag(X,O){const[Q,st]=this.parentDimensions;if(this.x+=X/Q,this.y+=O/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,O]=this.pageDimensions;let{x:Q,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=O,Q*=X,st*=O,this.rotation){case 0:Q=Math.max(0,Math.min(X-et,Q)),st=Math.max(0,Math.min(O-Mt,st));break;case 90:Q=Math.max(0,Math.min(X-Mt,Q)),st=Math.min(O,Math.max(et,st));break;case 180:Q=Math.min(X,Math.max(et,Q)),st=Math.min(O,Math.max(Mt,st));break;case 270:Q=Math.min(X,Math.max(Mt,Q)),st=Math.max(0,Math.min(O-et,st));break}this.x=Q/=X,this.y=st/=O;const[Rt,gt]=nl(this,$,ye).call(this);Q+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*Q).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,O){var Q;return nl(Q=w,Zt,Te).call(Q,X,O,this.parentRotation)}pageTranslationToScreen(X,O){var Q;return nl(Q=w,Zt,Te).call(Q,X,O,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[O,Q]}=this,st=O*X,et=Q*X;return T.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,O){var et;const[Q,st]=this.parentDimensions;this.div.style.width=`${(100*X/Q).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*O/st).toFixed(2)}%`),(et=bt(this,S))==null||et.classList.toggle("small",XQ.stopPropagation()),X.addEventListener("click",Q=>{Q.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",Q=>{Q.target===X&&Q.key==="Enter"&&(Q.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Lt,Le).call(this),this.div.append(X),w.SMALL_EDITOR_SIZE||(w.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,J),decorative:bt(this,p)}}set altTextData({altText:X,decorative:O}){bt(this,J)===X&&bt(this,p)===O||(ul(this,J,X),ul(this,p,O),nl(this,Lt,Le).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,g)),this.div.addEventListener("focusout",bt(this,I));const[X,O]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*O/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/O).toFixed(2)}%`);const[Q,st]=this.getInitialTranslation();return this.translate(Q,st),(0,m.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:O}=T.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&O){X.preventDefault();return}ul(this,C,!0),nl(this,Pt,ds).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,O,Q){X.changeParent(this),this.x=O,this.y=Q,this.fixAndSetPosition()}getRect(X,O){const Q=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/Q,Jt=O/Q,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,O){const[Q,st,et,Mt]=X,Rt=et-Q,gt=Mt-st;switch(this.rotation){case 0:return[Q,O-Mt,Rt,gt];case 90:return[Q,O-st,gt,Rt];case 180:return[et,O-st,Rt,gt];case 270:return[et,O-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,K,!0)}disableEditMode(){ul(this,K,!1)}isInEditMode(){return bt(this,K)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,O;(X=this.div)==null||X.addEventListener("focusin",bt(this,g)),(O=this.div)==null||O.addEventListener("focusout",bt(this,I))}serialize(X=!1,O=null){(0,T.unreachable)("An editor must be serializable")}static deserialize(X,O,Q){const st=new this.prototype.constructor({parent:O,id:O.getNextId(),uiManager:Q});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,g)),this.div.removeEventListener("focusout",bt(this,I)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,S))==null||X.remove(),ul(this,S,null),ul(this,_,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,L).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,O,Q;(X=bt(this,L))==null||X.classList.add("hidden"),(O=this.div)==null||O.classList.remove("selectedEditor"),(Q=this.div)!=null&&Q.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,O){}disableEditing(){bt(this,S)&&(bt(this,S).hidden=!0)}enableEditing(){bt(this,S)&&(bt(this,S).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,j)}set isEditing(X){ul(this,j,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,O){ul(this,f,!0);const Q=X/O,{style:st}=this.div;st.aspectRatio=Q,st.height="auto"}static get MIN_SIZE(){return 16}};J=new WeakMap,p=new WeakMap,S=new WeakMap,_=new WeakMap,U=new WeakMap,f=new WeakMap,L=new WeakMap,g=new WeakMap,I=new WeakMap,C=new WeakMap,j=new WeakMap,K=new WeakMap,P=new WeakMap,M=new WeakMap,u=new WeakSet,Ye=function([X,O],Q,st){[Q,st]=this.screenToPageTranslation(Q,st),this.x+=Q/X,this.y+=st/O,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,O]=this.parentDimensions,{_borderLineWidth:Q}=w,st=Q/X,et=Q/O;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,O,Q){switch(Q){case 90:return[O,-X];case 180:return[-X,-O];case 270:return[-O,X];default:return[X,O]}},It=new WeakSet,Ve=function(X){switch(X){case 90:{const[O,Q]=this.pageDimensions;return[0,-O/Q,Q/O,0]}case 180:return[-1,0,0,-1];case 270:{const[O,Q]=this.pageDimensions;return[0,O/Q,-Q/O,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,L))return;ul(this,L,document.createElement("div")),bt(this,L).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const O of X){const Q=document.createElement("div");bt(this,L).append(Q),Q.classList.add("resizer",O),Q.addEventListener("pointerdown",nl(this,zt,cs).bind(this,O)),Q.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,L))},zt=new WeakSet,cs=function(X,O){O.preventDefault();const{isMac:Q}=T.FeatureTest.platform;if(O.button!==0||O.ctrlKey&&Q)return;const st=nl(this,Nt,as).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(O.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,Yt]=this.parentDimensions;this.setDims(wt*Bt,Yt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,Yt]=this.parentDimensions;this.setDims(wt*Jt,Yt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,as=function(X,O){const[Q,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=w.MIN_SIZE/Q,Dt=w.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Ve).call(this,this.rotation),cl=(Tt,Ct)=>[vt[0]*Tt+vt[2]*Ct,vt[1]*Tt+vt[3]*Ct],bl=nl(this,It,Ve).call(this,360-this.rotation),il=(Tt,Ct)=>[bl[0]*Tt+bl[2]*Ct,bl[1]*Tt+bl[3]*Ct];let Bt,Ft,wt=!1,Yt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,Ct)=>[0,0],Ft=(Tt,Ct)=>[Tt,Ct];break;case"topMiddle":Bt=(Tt,Ct)=>[Tt/2,0],Ft=(Tt,Ct)=>[Tt/2,Ct];break;case"topRight":wt=!0,Bt=(Tt,Ct)=>[Tt,0],Ft=(Tt,Ct)=>[0,Ct];break;case"middleRight":Yt=!0,Bt=(Tt,Ct)=>[Tt,Ct/2],Ft=(Tt,Ct)=>[0,Ct/2];break;case"bottomRight":wt=!0,Bt=(Tt,Ct)=>[Tt,Ct],Ft=(Tt,Ct)=>[0,0];break;case"bottomMiddle":Bt=(Tt,Ct)=>[Tt/2,Ct],Ft=(Tt,Ct)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,Ct)=>[0,Ct],Ft=(Tt,Ct)=>[Tt,0];break;case"middleLeft":Yt=!0,Bt=(Tt,Ct)=>[0,Ct/2],Ft=(Tt,Ct)=>[Tt,Ct/2];break}const jt=Bt(Rt,gt),$t=Ft(Rt,gt);let al=cl(...$t);const Ml=qt(et+al[0]),pl=qt(Mt+al[1]);let Xl=1,Yl=1,[Vl,yl]=this.screenToPageTranslation(O.movementX,O.movementY);if([Vl,yl]=il(Vl/Q,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=Yl=Math.max(Math.min(Math.hypot($t[0]-jt[0]-Vl,$t[1]-jt[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else Yt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-jt[0]-Vl)))/Rt:Yl=Math.max(Dt,Math.min(1,Math.abs($t[1]-jt[1]-yl)))/gt;const Ll=qt(Rt*Xl),_t=qt(gt*Yl);al=cl(...Ft(Ll,_t));const ot=Ml-al[0],ut=pl-al[1];this.width=Ll,this.height=_t,this.x=ot,this.y=ut,this.setDims(Q*Ll,st*_t),this.fixAndSetPosition()},Lt=new WeakSet,Le=async function(){var Q;const X=bt(this,S);if(!X)return;if(!bt(this,J)&&!bt(this,p)){X.classList.remove("done"),(Q=bt(this,_))==null||Q.remove();return}w._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let O=bt(this,_);if(!O){ul(this,_,O=document.createElement("span")),O.className="tooltip",O.setAttribute("role","tooltip");const st=O.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,U,setTimeout(()=>{ul(this,U,null),bt(this,_).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,U)),ul(this,U,null),(Mt=bt(this,_))==null||Mt.classList.remove("show")})}X.classList.add("done"),O.innerText=bt(this,p)?await w._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,J),O.parentNode||X.append(O)},Pt=new WeakSet,ds=function(X){if(!this._isDraggable)return;const O=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let Q,st;O&&(Q={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,Q));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),O&&window.removeEventListener("pointermove",st,Q),ul(this,C,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=T.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(w,Zt),gl(w,"_borderLineWidth",-1),gl(w,"_colorManager",new m.ColorManager),gl(w,"_zIndex",1),gl(w,"SMALL_EDITOR_SIZE",0);let v=w;r.AnnotationEditor=v;class F extends v{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,L,g,I,C,Ie,P,M,u,q,$,ns,at,It,xt,it,Xt,zt,Gt,Nt,Ut,Lt,Ht,Pt,dt,w,k,X,O,Q,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,Yt,jt,Zs,al,ze,pl,Re,Yl,de,yl,Se,_t,we,ut,Jl,Ct,_l,Vt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=v;var m=h(1),T=h(6);function B(nt,R,ct){for(const Wt of ct)R.addEventListener(Wt,nt[Wt].bind(nt))}function v(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class F{constructor(){ll(this,f,0)}getId(){return`${m.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const K=class K{constructor(){ll(this,C);ll(this,L,(0,m.getUuid)());ll(this,g,0);ll(this,I,null)}static get _isSVGFittingCanvas(){const R='data:image/svg+xml;charset=UTF-8,',Wt=new OffscreenCanvas(1,3).getContext("2d"),pt=new Image;pt.src=R;const kt=pt.decode().then(()=>(Wt.drawImage(pt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,m.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(R){const{lastModified:ct,name:Wt,size:pt,type:kt}=R;return nl(this,C,Ie).call(this,`${ct}_${Wt}_${pt}_${kt}`,R)}async getFromUrl(R){return nl(this,C,Ie).call(this,R,R)}async getFromId(R){bt(this,I)||ul(this,I,new Map);const ct=bt(this,I).get(R);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(R){const ct=bt(this,I).get(R);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(R){bt(this,I)||ul(this,I,new Map);const ct=bt(this,I).get(R);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(R){return R.startsWith(`image_${bt(this,L)}_`)}};L=new WeakMap,g=new WeakMap,I=new WeakMap,C=new WeakSet,Ie=async function(R,ct){bt(this,I)||ul(this,I,new Map);let Wt=bt(this,I).get(R);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,L)}_${Al(this,g)._++}`,refCounter:0,isSvg:!1});let pt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);pt=await kt.blob()}else pt=Wt.file=ct;if(pt.type==="image/svg+xml"){const kt=K._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((dl,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,dl()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(pt),await ml}else Wt.bitmap=await createImageBitmap(pt);Wt.refCounter=1}catch(pt){console.error(pt),Wt=null}return bt(this,I).set(R,Wt),Wt&&bt(this,I).set(Wt.id,Wt),Wt};let J=K;class p{constructor(R=128){ll(this,P,[]);ll(this,M,!1);ll(this,u,void 0);ll(this,q,-1);ul(this,u,R)}add({cmd:R,undo:ct,mustExec:Wt,type:pt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&R(),bt(this,M))return;const sl={cmd:R,undo:ct,type:pt};if(bt(this,q)===-1){bt(this,P).length>0&&(bt(this,P).length=0),ul(this,q,0),bt(this,P).push(sl);return}if(kt&&bt(this,P)[bt(this,q)].type===pt){Et&&(sl.undo=bt(this,P)[bt(this,q)].undo),bt(this,P)[bt(this,q)]=sl;return}const ml=bt(this,q)+1;ml===bt(this,u)?bt(this,P).splice(0,1):(ul(this,q,ml),mlkt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(R){const ct=this._colors.get(R);return ct?m.Util.makeHexColor(...ct):R}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let _=Zt;r.ColorManager=_;const Wl=class Wl{constructor(R,ct,Wt,pt,kt,Et){ll(this,jt);ll(this,al);ll(this,pl);ll(this,Yl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,Ct);ll(this,Vt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,at,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new p);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Lt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,dt,new F);ll(this,w,!1);ll(this,k,!1);ll(this,X,null);ll(this,O,m.AnnotationEditorType.NONE);ll(this,Q,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,Yt,null);ul(this,wt,R),ul(this,Yt,ct),ul(this,it,Wt),this._eventBus=pt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:T.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const R=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,pt=this.TRANSLATE_BIG;return(0,m.shadow)(this,"_keyboardManager",new S([[["ctrl+a","mac+meta+a"],R.selectAll],[["ctrl+z","mac+meta+z"],R.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],R.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],R.delete],[["Escape","mac+Escape"],R.unselectAll],[["ArrowLeft","mac+ArrowLeft"],R.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],R.translateSelectedEditors,{args:[-pt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],R.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],R.translateSelectedEditors,{args:[pt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],R.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],R.translateSelectedEditors,{args:[0,-pt],checker:ct}],[["ArrowDown","mac+ArrowDown"],R.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],R.translateSelectedEditors,{args:[0,pt],checker:ct}]]))}destroy(){nl(this,Yl,de).call(this),nl(this,al,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const R of bt(this,xt).values())R.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,at,null),bt(this,Q).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,m.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,m.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(R){var ct;(ct=bt(this,it))==null||ct.editAltText(this,R)}onPageChanging({pageNumber:R}){ul(this,Gt,R-1)}focusMainContainer(){bt(this,wt).focus()}findParent(R,ct){for(const Wt of bt(this,xt).values()){const{x:pt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(R>=pt&&R<=pt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(R=!1){bt(this,Yt).classList.toggle("noUserSelect",R)}addShouldRescale(R){bt(this,Ht).add(R)}removeShouldRescale(R){bt(this,Ht).delete(R)}onScaleChanging({scale:R}){this.commitOrRemove(),this.viewParameters.realScale=R*T.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:R}){this.commitOrRemove(),this.viewParameters.rotation=R}addToAnnotationStorage(R){!R.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(R.id)&&bt(this,Xt).setValue(R.id,R)}blur(){if(!this.hasSelection)return;const{activeElement:R}=document;for(const ct of bt(this,Q))if(ct.div.contains(R)){ul(this,X,[ct,R]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[R,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{R._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,pl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,Yl,de).call(this),nl(this,_t,we).call(this)}copy(R){var Wt;if(R.preventDefault(),(Wt=bt(this,at))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const pt of bt(this,Q)){const kt=pt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&R.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(R){this.copy(R),this.delete()}paste(R){R.preventDefault();const{clipboardData:ct}=R;for(const kt of ct.items)for(const Et of bt(this,Lt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,m.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const pt=this.currentLayer;try{const kt=[];for(const ml of Wt){const dl=pt.deserialize(ml);if(!dl)return;kt.push(dl)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,m.warn)(`paste: "${kt.message}".`)}}keydown(R){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,R)}onEditingAction(R){["undo","redo","delete","selectAll"].includes(R.name)&&this[R.name]()}setEditingState(R){R?(nl(this,jt,Zs).call(this),nl(this,pl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,O)!==m.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,al,ze).call(this),nl(this,Yl,de).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(R){if(!bt(this,Lt)){ul(this,Lt,R);for(const ct of bt(this,Lt))nl(this,Ct,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,dt).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(R){return bt(this,xt).get(R)}get currentPageIndex(){return bt(this,Gt)}addLayer(R){bt(this,xt).set(R.pageIndex,R),bt(this,w)?R.enable():R.disable()}removeLayer(R){bt(this,xt).delete(R.pageIndex)}updateMode(R,ct=null){if(bt(this,O)!==R){if(ul(this,O,R),R===m.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Vt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(R);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(R){R!==bt(this,O)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:R})}updateParams(R,ct){if(bt(this,Lt)){if(R===m.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(R);return}for(const Wt of bt(this,Q))Wt.updateParams(R,ct);for(const Wt of bt(this,Lt))Wt.updateDefaultParams(R,ct)}}enableWaiting(R=!1){if(bt(this,k)!==R){ul(this,k,R);for(const ct of bt(this,xt).values())R?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",R)}}getEditors(R){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===R&&ct.push(Wt);return ct}getEditor(R){return bt(this,It).get(R)}addEditor(R){bt(this,It).set(R.id,R)}removeEditor(R){var ct;bt(this,It).delete(R.id),this.unselect(R),(!R.annotationElementId||!bt(this,Nt).has(R.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(R.id))}addDeletedAnnotationElement(R){bt(this,Nt).add(R.annotationElementId),R.deleted=!0}isDeletedAnnotationElement(R){return bt(this,Nt).has(R)}removeDeletedAnnotationElement(R){bt(this,Nt).delete(R.annotationElementId),R.deleted=!1}setActiveEditor(R){bt(this,at)!==R&&(ul(this,at,R),R&&nl(this,Ct,_l).call(this,R.propertiesToUpdate))}toggleSelected(R){if(bt(this,Q).has(R)){bt(this,Q).delete(R),R.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,Q).add(R),R.select(),nl(this,Ct,_l).call(this,R.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(R){for(const ct of bt(this,Q))ct!==R&&ct.unselect();bt(this,Q).clear(),bt(this,Q).add(R),R.select(),nl(this,Ct,_l).call(this,R.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(R){return bt(this,Q).has(R)}unselect(R){R.unselect(),bt(this,Q).delete(R),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,Q).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(R){bt(this,zt).add(R),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const R=[...bt(this,Q)],ct=()=>{for(const pt of R)pt.remove()},Wt=()=>{for(const pt of R)nl(this,el,xe).call(this,pt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var R;(R=bt(this,at))==null||R.commitOrRemove()}hasSomethingToControl(){return bt(this,at)||this.hasSelection}selectAll(){for(const R of bt(this,Q))R.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,at)){bt(this,at).commitOrRemove();return}if(this.hasSelection){for(const R of bt(this,Q))R.unselect();bt(this,Q).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(R,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=R,bt(this,Bt)[1]+=ct;const[pt,kt]=bt(this,Bt),Et=[...bt(this,Q)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(pt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-pt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(R,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const R of bt(this,Q))bt(this,Ut).set(R,{savedX:R.x,savedY:R.y,savedPageIndex:R.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const R=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:pt,y:kt,pageIndex:Et},sl]of R)sl.newX=pt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=pt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(pt,kt,Et,sl)=>{if(bt(this,It).has(pt.id)){const ml=bt(this,xt).get(sl);ml?pt._setParentAndPosition(ml,kt,Et):(pt.pageIndex=sl,pt.x=kt,pt.y=Et)}};return this.addCommands({cmd:()=>{for(const[pt,{newX:kt,newY:Et,newPageIndex:sl}]of R)Wt(pt,kt,Et,sl)},undo:()=>{for(const[pt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of R)Wt(pt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(R,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(R,ct)}rebuild(R){if(R.parent===null){const ct=this.getLayer(R.pageIndex);ct?(ct.changeParent(R),ct.addOrRebuild(R)):(this.addEditor(R),this.addToAnnotationStorage(R),R.rebuild())}else R.parent.addOrRebuild(R)}isActive(R){return bt(this,at)===R}getActive(){return bt(this,at)}getMode(){return bt(this,O)}get imageManager(){return(0,m.shadow)(this,"imageManager",new J)}};at=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,dt=new WeakMap,w=new WeakMap,k=new WeakMap,X=new WeakMap,O=new WeakMap,Q=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,Yt=new WeakMap,jt=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},al=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},pl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},Yl=new WeakSet,de=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(R){Object.entries(R).some(([Wt,pt])=>bt(this,il)[Wt]!==pt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),R)})},Ct=new WeakSet,_l=function(R){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:R})},Vt=new WeakSet,hs=function(){if(!bt(this,w)){ul(this,w,!0);for(const R of bt(this,xt).values())R.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,w)){ul(this,w,!1);for(const R of bt(this,xt).values())R.disable()}},el=new WeakSet,xe=function(R){const ct=bt(this,xt).get(R.pageIndex);ct?ct.addOrRebuild(R):this.addEditor(R)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const R of bt(this,It).values())return R.isEmpty();return!1},hl=new WeakSet,ke=function(R){bt(this,Q).clear();for(const ct of R)ct.isEmpty()||(bt(this,Q).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let U=Wl;r.AnnotationEditorUIManager=U},(lt,r,h)=>{var Gt,Nt,Ut,Lt,Ht,Pt,dt,w,k,X,O,Q,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=q,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=C,r.getPdfFilenameFromUrl=j,r.getRGB=at,r.getXfaPageViewport=Zt,r.isDataScheme=g,r.isPdfFile=I,r.isValidFetchUrl=P,r.loadScript=u,r.noContextMenu=M,r.setLayerDimensions=Xt;var m=h(7),T=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let v=zt;r.PixelsPerInch=v;class F extends m.BaseFilterFactory{constructor({docId:Yt,ownerDocument:jt=globalThis.document}={}){super();ll(this,Q);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Lt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,dt,void 0);ll(this,w,void 0);ll(this,k,void 0);ll(this,X,void 0);ll(this,O,0);ul(this,Ut,Yt),ul(this,Lt,jt)}addFilter(Yt){if(!Yt)return"none";let jt=bt(this,Q,Pl).get(Yt);if(jt)return jt;let $t,al,Ml,pl;if(Yt.length===1){const yl=Yt[0],Ll=new Array(256);for(let _t=0;_t<256;_t++)Ll[_t]=yl[_t]/255;pl=$t=al=Ml=Ll.join(",")}else{const[yl,Ll,_t]=Yt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let Ct=0;Ct<256;Ct++)ot[Ct]=yl[Ct]/255,ut[Ct]=Ll[Ct]/255,Tt[Ct]=_t[Ct]/255;$t=ot.join(","),al=ut.join(","),Ml=Tt.join(","),pl=`${$t}${al}${Ml}`}if(jt=bt(this,Q,Pl).get(pl),jt)return bt(this,Q,Pl).set(Yt,jt),jt;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,O)._++}`,Yl=`url(#${Xl})`;bt(this,Q,Pl).set(Yt,Yl),bt(this,Q,Pl).set(pl,Yl);const Vl=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,al,Ml,Vl),Yl}addHCMFilter(Yt,jt){var Ll;const $t=`${Yt}-${jt}`;if(bt(this,Pt)===$t)return bt(this,dt);if(ul(this,Pt,$t),ul(this,dt,"none"),(Ll=bt(this,Ht))==null||Ll.remove(),!Yt||!jt)return bt(this,dt);const al=nl(this,il,te).call(this,Yt);Yt=T.Util.makeHexColor(...al);const Ml=nl(this,il,te).call(this,jt);if(jt=T.Util.makeHexColor(...Ml),bt(this,et,Hl).style.color="",Yt==="#000000"&&jt==="#ffffff"||Yt===jt)return bt(this,dt);const pl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;pl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=pl.join(","),Yl=`g_${bt(this,Ut)}_hcm_filter`,Vl=ul(this,w,nl(this,Jt,ne).call(this,Yl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Vl),nl(this,Rt,ge).call(this,Vl);const yl=(_t,ot)=>{const ut=al[_t]/255,Tt=Ml[_t]/255,Ct=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)Ct[Ot]=ut+Ot/ot*(Tt-ut);return Ct.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Vl),ul(this,dt,`url(#${Yl})`),bt(this,dt)}addHighlightHCMFilter(Yt,jt,$t,al){var Tt;const Ml=`${Yt}-${jt}-${$t}-${al}`;if(bt(this,k)===Ml)return bt(this,X);if(ul(this,k,Ml),ul(this,X,"none"),(Tt=bt(this,w))==null||Tt.remove(),!Yt||!jt)return bt(this,X);const[pl,Xl]=[Yt,jt].map(nl(this,il,te).bind(this));let Yl=Math.round(.2126*pl[0]+.7152*pl[1]+.0722*pl[2]),Vl=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Ll]=[$t,al].map(nl(this,il,te).bind(this));Vl{const yt=new Array(256),Kt=(Vl-Yl)/Vt,tl=Ct/255,el=(Ot-Ct)/(255*Vt);let ol=0;for(let Qt=0;Qt<=Vt;Qt++){const rl=Math.round(Yl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=rl;Il++)yt[Il]=hl;ol=rl+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,w,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Ll[0],5),_t(yl[1],Ll[1],5),_t(yl[2],Ll[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(Yt=!1){Yt&&(bt(this,dt)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,O,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,dt=new WeakMap,w=new WeakMap,k=new WeakMap,X=new WeakMap,O=new WeakMap,Q=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const Yt=bt(this,Lt).createElement("div"),{style:jt}=Yt;jt.visibility="hidden",jt.contain="strict",jt.width=jt.height=0,jt.position="absolute",jt.top=jt.left=0,jt.zIndex=-1;const $t=bt(this,Lt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Lt).createElementNS(B,"defs")),Yt.append($t),$t.append(bt(this,Nt)),bt(this,Lt).body.append(Yt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(Yt){const jt=bt(this,Lt).createElementNS(B,"feColorMatrix");jt.setAttribute("type","matrix"),jt.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),Yt.append(jt)},Jt=new WeakSet,ne=function(Yt){const jt=bt(this,Lt).createElementNS(B,"filter");return jt.setAttribute("color-interpolation-filters","sRGB"),jt.setAttribute("id",Yt),bt(this,et,Hl).append(jt),jt},qt=new WeakSet,Ze=function(Yt,jt,$t){const al=bt(this,Lt).createElementNS(B,jt);al.setAttribute("type","discrete"),al.setAttribute("tableValues",$t),Yt.append(al)},cl=new WeakSet,$l=function(Yt,jt,$t,al){const Ml=bt(this,Lt).createElementNS(B,"feComponentTransfer");al.append(Ml),nl(this,qt,Ze).call(this,Ml,"feFuncR",Yt),nl(this,qt,Ze).call(this,Ml,"feFuncG",jt),nl(this,qt,Ze).call(this,Ml,"feFuncB",$t)},il=new WeakSet,te=function(Yt){return bt(this,et,Hl).style.color=Yt,at(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=F;class J extends m.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,Yt){const jt=this._document.createElement("canvas");return jt.width=wt,jt.height=Yt,jt}}r.DOMCanvasFactory=J;async function p(Ft,wt=!1){if(P(Ft,document.baseURI)){const Yt=await fetch(Ft);if(!Yt.ok)throw new Error(Yt.statusText);return wt?new Uint8Array(await Yt.arrayBuffer()):(0,T.stringToBytes)(await Yt.text())}return new Promise((Yt,jt)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let al;if(wt&&$t.response?al=new Uint8Array($t.response):!wt&&$t.responseText&&(al=(0,T.stringToBytes)($t.responseText)),al){Yt(al);return}}jt(new Error($t.statusText))}},$t.send(null)})}class S extends m.BaseCMapReaderFactory{_fetchData(wt,Yt){return p(wt,this.isCompressed).then(jt=>({cMapData:jt,compressionType:Yt}))}}r.DOMCMapReaderFactory=S;class _ extends m.BaseStandardFontDataFactory{_fetchData(wt){return p(wt,!0)}}r.DOMStandardFontDataFactory=_;class U extends m.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=U;class f{constructor({viewBox:wt,scale:Yt,rotation:jt,offsetX:$t=0,offsetY:al=0,dontFlip:Ml=!1}){this.viewBox=wt,this.scale=Yt,this.rotation=jt,this.offsetX=$t,this.offsetY=al;const pl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let Yl,Vl,yl,Ll;switch(jt%=360,jt<0&&(jt+=360),jt){case 180:Yl=-1,Vl=0,yl=0,Ll=1;break;case 90:Yl=0,Vl=1,yl=1,Ll=0;break;case 270:Yl=0,Vl=-1,yl=-1,Ll=0;break;case 0:Yl=1,Vl=0,yl=0,Ll=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ml&&(yl=-yl,Ll=-Ll);let _t,ot,ut,Tt;Yl===0?(_t=Math.abs(Xl-wt[1])*Yt+$t,ot=Math.abs(pl-wt[0])*Yt+al,ut=(wt[3]-wt[1])*Yt,Tt=(wt[2]-wt[0])*Yt):(_t=Math.abs(pl-wt[0])*Yt+$t,ot=Math.abs(Xl-wt[1])*Yt+al,ut=(wt[2]-wt[0])*Yt,Tt=(wt[3]-wt[1])*Yt),this.transform=[Yl*Yt,Vl*Yt,yl*Yt,Ll*Yt,_t-Yl*Yt*pl-yl*Yt*Xl,ot-Vl*Yt*pl-Ll*Yt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,T.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:Yt=this.rotation,offsetX:jt=this.offsetX,offsetY:$t=this.offsetY,dontFlip:al=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:Yt,offsetX:jt,offsetY:$t,dontFlip:al})}convertToViewportPoint(wt,Yt){return T.Util.applyTransform([wt,Yt],this.transform)}convertToViewportRectangle(wt){const Yt=T.Util.applyTransform([wt[0],wt[1]],this.transform),jt=T.Util.applyTransform([wt[2],wt[3]],this.transform);return[Yt[0],Yt[1],jt[0],jt[1]]}convertToPdfPoint(wt,Yt){return T.Util.applyInverseTransform([wt,Yt],this.transform)}}r.PageViewport=f;class L extends T.BaseException{constructor(wt,Yt=0){super(wt,"RenderingCancelledException"),this.extraDelay=Yt}}r.RenderingCancelledException=L;function g(Ft){const wt=Ft.length;let Yt=0;for(;Ytr in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,m)=>(Xe(lt,r,"write to private field"),m?m.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,m)=>({set _(T){ul(lt,r,T,h)},get _(){return bt(lt,r,m)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{a7 as propsFactory,ab as genericComponent,af as useRender,x as createVNode,z as mergeProps,c_ as omit,c$ as IconValue,d0 as getUid,f as computed,ak as useProxiedModel,d1 as filterInputAttrs,S as Fragment,r as ref,s as openBlock,R as createElementBlock,v as withCtx,E as VCol,K as VCard,T as renderList,F as VCardActions,t as createBlock,y as createTextVNode,A as VBtn,a0 as createCommentVNode,D as VRow,M as createBaseVNode,$ as toDisplayString,cP as getAugmentedNamespace$1,ah as shallowRef,ao as watchEffect,e as onBeforeUnmount,bk as defineComponent,ck as toValue,an as toRef,w as watch,c3 as renderSlot,bO as normalizeStyle,cQ as commonjsGlobal$1,Q as resolveComponent,u as unref,X as VImg,L as VDialog,U as axiosApiInstance,cT as VCardSubtitle,a5 as baseURL,_ as _export_sfc,d2 as get_name,B as VCardTitle,aP as normalizeClass,I as VProgressLinear,G as withDirectives,H as vShow,C as VCardText,Z as VDivider,d3 as spravURLBase,a3 as VListItem,V as VIcon,cV as pagecounter,cN as useRoute,bX as onUpdated}from"./index-f3f24177.js";import{P as PatternTabs}from"./PatternTabs-b63c46f1.js";import{V as VWindow,a as VWindowItem}from"./VWindowItem-903bb0f4.js";import{V as VSpacer}from"./VSpacer-9ba25539.js";import{V as VContainer}from"./VContainer-1fb03ac7.js";import{m as makeVInputProps,V as VInput,a as VLabel}from"./VInput-3de7b4b2.js";import{m as makeVSelectionControlProps,V as VSelectionControl,a as makeSelectionControlGroupProps,b as VSelectionControlGroup}from"./VSelectionControl-9e0e68f5.js";import{V as VCheckbox}from"./VCheckbox-b7b2cfc8.js";import{V as VExpansionPanels,a as VExpansionPanel,b as VExpansionPanelTitle,c as VExpansionPanelText}from"./VExpansionPanels-203409e8.js";import{V as VList}from"./VList-983e49dd.js";import"./VTabs-cea59e65.js";import"./ssrBoot-4527a6ac.js";import"./VCheckboxBtn-53ca7935.js";const makeVRadioProps=propsFactory({...makeVSelectionControlProps({falseIcon:"$radioOff",trueIcon:"$radioOn"})},"VRadio"),VRadio=genericComponent()({name:"VRadio",props:makeVRadioProps(),setup(lt,r){let{slots:h}=r;return useRender(()=>createVNode(VSelectionControl,mergeProps(lt,{class:["v-radio",lt.class],style:lt.style,type:"radio"}),h)),{}}}),VRadioGroup$1="",makeVRadioGroupProps=propsFactory({height:{type:[Number,String],default:"auto"},...makeVInputProps(),...omit(makeSelectionControlGroupProps(),["multiple"]),trueIcon:{type:IconValue,default:"$radioOn"},falseIcon:{type:IconValue,default:"$radioOff"},type:{type:String,default:"radio"}},"VRadioGroup"),VRadioGroup=genericComponent()({name:"VRadioGroup",inheritAttrs:!1,props:makeVRadioGroupProps(),emits:{"update:modelValue":lt=>!0},setup(lt,r){let{attrs:h,slots:m}=r;const T=getUid(),B=computed(()=>lt.id||`radio-group-${T}`),v=useProxiedModel(lt,"modelValue");return useRender(()=>{const[F,J]=filterInputAttrs(h),p=VInput.filterProps(lt),S=VSelectionControl.filterProps(lt),_=m.label?m.label({label:lt.label,props:{for:B.value}}):lt.label;return createVNode(VInput,mergeProps({class:["v-radio-group",lt.class],style:lt.style},F,p,{modelValue:v.value,"onUpdate:modelValue":U=>v.value=U,id:B.value}),{...m,default:U=>{let{id:f,messagesId:L,isDisabled:g,isReadonly:I}=U;return createVNode(Fragment,null,[_&&createVNode(VLabel,{id:f.value},{default:()=>[_]}),createVNode(VSelectionControlGroup,mergeProps(S,{id:f.value,"aria-describedby":L.value,defaultsTarget:"VRadio",trueIcon:lt.trueIcon,falseIcon:lt.falseIcon,type:lt.type,disabled:g.value,readonly:I.value,"aria-labelledby":_?f.value:void 0,multiple:!1},J,{modelValue:v.value,"onUpdate:modelValue":C=>v.value=C}),m)])}})}),{}}}),_sfc_main$4={__name:"TestSafety",props:{data:Array},setup(lt){const r=ref([{question:"Вопрос 1",answers:["1","2","3","4"]},{question:"Вопрос 2",answers:["Rer","LoL","Fort","FullG"]},{checkQuestion:"Вопрос с чексбоксом",answers:["Кукумбер","Сикельд"]}]),h=ref(""),m=ref([]),T=ref([]),B=ref(0);return(v,F)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(VRow,null,{default:withCtx(()=>[createVNode(VCol,{cols:"12"},{default:withCtx(()=>[createVNode(VCard,null,{default:withCtx(()=>[createVNode(VWindow,{modelValue:B.value,"onUpdate:modelValue":F[2]||(F[2]=J=>B.value=J)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(J,p)=>(openBlock(),createBlock(VWindowItem,{key:p},{default:withCtx(()=>[J.question?(openBlock(),createBlock(VCard,{key:0,title:J.question},{default:withCtx(()=>[createVNode(VRadioGroup,{modelValue:h.value,"onUpdate:modelValue":F[0]||(F[0]=S=>h.value=S),label:"Выберите вариант ответа"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(J.answers,S=>(openBlock(),createBlock(VRadio,{label:S,value:S},null,8,["label","value"]))),256))]),_:2},1032,["modelValue"])]),_:2},1032,["title"])):createCommentVNode("",!0),J.checkQuestion?(openBlock(),createBlock(VCard,{key:1,title:J.checkQuestion},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(J.answers,S=>(openBlock(),createBlock(VCheckbox,{modelValue:m.value,"onUpdate:modelValue":F[1]||(F[1]=_=>m.value=_),label:S,value:S},null,8,["modelValue","label","value"]))),256))]),_:2},1032,["title"])):createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["modelValue"]),createVNode(VCardActions,null,{default:withCtx(()=>[B.value>0?(openBlock(),createBlock(VBtn,{key:0,variant:"text",onClick:F[3]||(F[3]=J=>B.value--)},{default:withCtx(()=>[createTextVNode(" Back ")]),_:1})):createCommentVNode("",!0),createVNode(VSpacer),B.valueB.value++)},{default:withCtx(()=>[createTextVNode(" Next ")]),_:1})):createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(VRow,null,{default:withCtx(()=>[createVNode(VCol,null,{default:withCtx(()=>[createVNode(VCard,{title:"Результат"},{default:withCtx(()=>[createVNode(VContainer,null,{default:withCtx(()=>[createBaseVNode("p",null,"Количество баллов: "+toDisplayString(T.value),1)]),_:1})]),_:1})]),_:1})]),_:1})],64))}};function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Ll;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=al,r.getUuid=Vl,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=jt,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=Yl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=Yt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const m=[1,0,0,1,0,0];r.IDENTITY_MATRIX=m;const T=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=T;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const v=1.35;r.LINE_FACTOR=v;const F=.35;r.LINE_DESCENT_FACTOR=F;const J=F/v;r.BASELINE_FACTOR=J;const p={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=p;const S={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=S;const _="pdfjs_internal_editor_";r.AnnotationEditorPrefix=_;const U={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=U;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const L={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=L;const g={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=g;const I={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=I;const C={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=C;const j={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=j;const K={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=K;const P={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=P;const M={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=M;const u={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=u;const q={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=q;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const H={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=H;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const at={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=at;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=H.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=H.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=H.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Lt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const Ct=_t.match(/\./g);(Ct==null?void 0:Ct.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Lt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const dt=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=dt;class w extends dt{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=w;class k extends dt{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=k;class X extends dt{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class O extends dt{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=O;class Q extends dt{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=Q;class st extends dt{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends dt{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],Ct=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,Ct]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],Ct=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[Ct,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),Ct=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Vt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],Ct[0],Ot[0],Vt[0]),Math.min(Tt[1],Ct[1],Ot[1],Vt[1]),Math.max(Tt[0],Ct[0],Ot[0],Vt[0]),Math.max(Tt[1],Ct[1],Ot[1],Vt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],Ct=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Vt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Vt)/2,Kt=Math.sqrt((Tt+Vt)**2-4*(Tt*Vt-Ot*Ct))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),Ct=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>Ct)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Vt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Vt?null:[Tt,Ot,Ct,Vt]}static bezierBoundingBox(ot,ut,Tt,Ct,Ot,Vt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,rl,hl,Il,Wl,nt,R;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,rl=3*Tt-3*ot):(Qt=6*ut-12*Ct+6*Vt,ol=-3*ut+9*Ct-9*Vt+3*Kt,rl=3*Ct-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-rl/Qt,0="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),Ct=Rt(_t);return Tt.decode(Ct)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut{this.resolve=Tt=>{ul(this,Ll,!0),ot(Tt)},this.reject=Tt=>{ul(this,Ll,!0),ut(Tt)}})}get settled(){return bt(this,Ll)}}Ll=new WeakMap,r.PromiseCapability=Ml;let pl=null,Xl=null;function Yl(_t){return pl||(pl=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(pl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Vl(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,m,T,vl,v,ce,J,p,S,_,U,f,L,g,I,ae,j,K,pe,M,u;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const H=new PDFDocumentLoadingTask,{docId:Zt}=H,at=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Lt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,dt=$.CMapReaderFactory||DefaultCMapReaderFactory,w=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,k=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,O=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,Q=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:dt===_display_utils.DOMCMapReaderFactory&&k===_display_utils.DOMStandardFontDataFactory&&Ht&&w&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(w,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),Yt=null;(0,_util.setVerbosityLevel)(Ut);const jt={canvasFactory:Ft,filterFactory:wt};if(Bt||(jt.cMapReaderFactory=new dt({baseUrl:Ht,isCompressed:Pt}),jt.standardFontDataFactory=new k({baseUrl:w})),!Nt){const Ml={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=Ml.port?PDFWorker.fromPort(Ml):new PDFWorker(Ml),H._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Lt,enableXfa:gt,evaluatorOptions:{maxImageSize:O,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:Q,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?w:null}},al={ignoreErrors:X,isEvalSupported:Q,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:Yt};return Nt.promise.then(function(){if(H.destroyed)throw new Error("Loading aborted");const Ml=_fetchDocument(Nt,$t),pl=new Promise(function(Xl){let Yl;zt?Yl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(Yl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:at,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(Yl)});return Promise.all([Ml,pl]).then(function([Xl,Yl]){if(H.destroyed)throw new Error("Loading aborted");const Vl=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Vl,H,Yl,al,jt);H._transport=yl,Vl.send("Ready",null)})}).catch(H._capability.reject),H}async function _fetchDocument($,H){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",H,H.data?[H.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var H,Zt,at;this.destroyed=!0;try{(H=this._worker)!=null&&H.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(at=this._worker)!=null&&at.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(H,Zt,at=!1,It=null){this.length=H,this.initialData=Zt,this.progressiveDone=at,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(H){this._rangeListeners.push(H)}addProgressListener(H){this._progressListeners.push(H)}addProgressiveReadListener(H){this._progressiveReadListeners.push(H)}addProgressiveDoneListener(H){this._progressiveDoneListeners.push(H)}onDataRange(H,Zt){for(const at of this._rangeListeners)at(H,Zt)}onDataProgress(H,Zt){this._readyCapability.promise.then(()=>{for(const at of this._progressListeners)at(H,Zt)})}onDataProgressiveRead(H){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(H)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const H of this._progressiveDoneListeners)H()})}transportReady(){this._readyCapability.resolve()}requestDataRange(H,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(H,Zt){this._pdfInfo=H,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(at=>{if(!at)return at;const It=[];for(const xt in at)It.push(...at[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(H){return this._transport.getPage(H)}getPageIndex(H){return this._transport.getPageIndex(H)}getDestinations(){return this._transport.getDestinations()}getDestination(H){return this._transport.getDestination(H)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(H=!1){return this._transport.startCleanup(H||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(H,Zt,at,It=!1){ll(this,T);ll(this,v);ll(this,h,null);ll(this,m,!1);this._pageIndex=H,this._pageInfo=Zt,this._transport=at,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=at.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:H,rotation:Zt=this.rotate,offsetX:at=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:H,rotation:Zt,offsetX:at,offsetY:It,dontFlip:xt})}getAnnotations({intent:H="display"}={}){const Zt=this._transport.getRenderingIntent(H);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var H;return((H=this._transport._htmlForXfa)==null?void 0:H.children[this._pageIndex])||null}render({canvasContext:H,viewport:Zt,intent:at="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var k,X;(k=this._stats)==null||k.time("Overall");const Ut=this._transport.getRenderingIntent(at,It,Nt);ul(this,m,!1),nl(this,v,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Lt=this._intentStates.get(Ut.cacheKey);Lt||(Lt=Object.create(null),this._intentStates.set(Ut.cacheKey,Lt)),Lt.streamReaderCancelTimeout&&(clearTimeout(Lt.streamReaderCancelTimeout),Lt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Lt.displayReadyCapability||(Lt.displayReadyCapability=new _util.PromiseCapability,Lt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=O=>{var Q,st;Lt.renderTasks.delete(dt),(this._maybeCleanupAfterRender||Ht)&&ul(this,m,!0),nl(this,T,vl).call(this,!Ht),O?(dt.capability.reject(O),this._abortOperatorList({intentState:Lt,reason:O instanceof Error?O:new Error(O)})):dt.capability.resolve(),(Q=this._stats)==null||Q.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},dt=new InternalRenderTask({callback:Pt,params:{canvasContext:H,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Lt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Lt.renderTasks||(Lt.renderTasks=new Set)).add(dt);const w=dt.task;return Promise.all([Lt.displayReadyCapability.promise,Xt]).then(([O,Q])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),dt.initializeGraphics({transparency:O,optionalContentConfig:Q}),dt.operatorListChanged()}).catch(Pt),w}getOperatorList({intent:H="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:at=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(H,Zt,at,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:H=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:H===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(H={}){if(this._transport._htmlForXfa)return this.getXfa().then(at=>_xfa_text.XfaText.textContent(at));const Zt=this.streamTextContent(H);return new Promise(function(at,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){at(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const H=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const at of Zt.renderTasks)H.push(at.completed),at.cancel();return this.objs.clear(),ul(this,m,!1),nl(this,v,ce).call(this),Promise.all(H)}cleanup(H=!1){ul(this,m,!0);const Zt=nl(this,T,vl).call(this,!1);return H&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(H,Zt){var It,xt;const at=this._intentStates.get(Zt);at&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=at.displayReadyCapability)==null||xt.resolve(H))}_renderPageChunk(H,Zt){for(let at=0,It=H.length;at{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,T,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:H,reason:Zt,force:at=!1}){if(H.streamReader){if(H.streamReaderCancelTimeout&&(clearTimeout(H.streamReaderCancelTimeout),H.streamReaderCancelTimeout=null),!at){if(H.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),H.streamReaderCancelTimeout=setTimeout(()=>{H.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:H,reason:Zt,force:!0})},It);return}}if(H.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),H.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===H){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,m=new WeakMap,T=new WeakSet,vl=function(H=!1){if(nl(this,v,ce).call(this),!bt(this,m)||this.destroyed)return!1;if(H)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,T,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:at}of this._intentStates.values())if(Zt.size>0||!at.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,m,!1),!0},v=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,J,new Set);ll(this,p,Promise.resolve())}postMessage(H,Zt){const at={data:structuredClone(H,Zt?{transfer:Zt}:null)};bt(this,p).then(()=>{for(const It of bt(this,J))It.call(this,at)})}addEventListener(H,Zt){bt(this,J).add(Zt)}removeEventListener(H,Zt){bt(this,J).delete(Zt)}terminate(){bt(this,J).clear()}}J=new WeakMap,p=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(S=document==null?void 0:document.currentScript)==null?void 0:S.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,H){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const at=new URL(H,Zt);return Zt.origin===at.origin},PDFWorkerUtil.createCDNWrapper=function($){const H=`importScripts("${$}");`;return URL.createObjectURL(new Blob([H]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:H=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var at;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,H){if((at=bt(_PDFWorker,_))!=null&&at.has(H))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,_)||ul(_PDFWorker,_,new WeakMap)).set(H,this),this._initializeFromPort(H);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const H=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",H),at=()=>{H.removeEventListener("error",It),Zt.destroy(),H.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||at()};H.addEventListener("error",It),Zt.on("test",it=>{if(H.removeEventListener("error",It),this.destroyed){at();return}it?(this._messageHandler=Zt,this._port=H,this._webWorker=H,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),H.terminate())}),Zt.on("ready",it=>{if(H.removeEventListener("error",It),this.destroyed){at();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const H=new LoopbackPort;this._port=H;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,at=new _message_handler.MessageHandler(Zt+"_worker",Zt,H);$.setup(at,H);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",H);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,_))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const H=(Zt=bt(this,_))==null?void 0:Zt.get($.port);if(H){if(H._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return H}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};_=new WeakMap,ll(_PDFWorker,_,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(H,Zt,at,It,xt){ll(this,I);ll(this,U,new Map);ll(this,f,new Map);ll(this,L,new Map);ll(this,g,null);this.messageHandler=H,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=at,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(H,Zt=_util.AnnotationMode.ENABLE,at=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(H){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${H}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&at instanceof _annotation_storage.PrintAnnotationStorage?at:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var at;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(at=bt(this,g))==null||at.reject(new Error("Worker was destroyed during onPassword callback"));const H=[];for(const It of bt(this,f).values())H.push(It._destroy());bt(this,f).clear(),bt(this,L).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return H.push(Zt),Promise.all(H).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,U).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:H,loadingTask:Zt}=this;H.on("GetReader",(at,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),H.on("ReaderHeadersReady",at=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),H.on("GetRangeReader",(at,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(at.begin,at.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),H.on("GetDoc",({pdfInfo:at})=>{this._numPages=at.numPages,this._htmlForXfa=at.htmlForXfa,delete at.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(at,this))}),H.on("DocException",function(at){let It;switch(at.name){case"PasswordException":It=new _util.PasswordException(at.message,at.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(at.message);break;case"MissingPDFException":It=new _util.MissingPDFException(at.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(at.message,at.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(at.message,at.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),H.on("PasswordRequest",at=>{if(ul(this,g,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,g).reject(xt):bt(this,g).resolve({password:xt})};try{Zt.onPassword(It,at.code)}catch(xt){bt(this,g).reject(xt)}}else bt(this,g).reject(new _util.PasswordException(at.message,at.code));return bt(this,g).promise}),H.on("DataLoaded",at=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:at.length,total:at.length}),this.downloadInfoCapability.resolve(at)}),H.on("StartRenderPage",at=>{if(this.destroyed)return;bt(this,f).get(at.pageIndex)._startRenderPage(at.transparency,at.cacheKey)}),H.on("commonobj",([at,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(at))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(at,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>H.sendWithPromise("FontFallback",{id:at})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(at,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(at,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),H.on("obj",([at,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(at))switch(xt){case"Image":if(Xt.objs.resolve(at,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(at,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),H.on("DocProgress",at=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:at.loaded,total:at.total})}),H.on("FetchBuiltInCMap",at=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(at):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),H.on("FetchStandardFontData",at=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(at):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var at;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:H,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:H,filename:((at=this._fullReader)==null?void 0:at.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(H){if(!Number.isInteger(H)||H<=0||H>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=H-1,at=bt(this,L).get(Zt);if(at)return at;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,L).set(Zt,It),It}getPageIndex(H){return typeof H!="object"||H===null||!Number.isInteger(H.num)||H.num<0||!Number.isInteger(H.gen)||H.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:H.num,gen:H.gen})}getAnnotations(H,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:H,intent:Zt})}getFieldObjects(){return nl(this,I,ae).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,I,ae).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(H){return typeof H!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:H})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return nl(this,I,ae).call(this,"GetDocJSActions")}getPageJSActions(H){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:H})}getStructTree(H){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:H})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(H=>new _optional_content_config.OptionalContentConfig(H))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const H="GetMetadata",Zt=bt(this,U).get(H);if(Zt)return Zt;const at=this.messageHandler.sendWithPromise(H,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,U).set(H,at),at}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(H=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),H||this.fontLoader.clear(),bt(this,U).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:H,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:H,enableXfa:Zt})}}U=new WeakMap,f=new WeakMap,L=new WeakMap,g=new WeakMap,I=new WeakSet,ae=function(H,Zt=null){const at=bt(this,U).get(H);if(at)return at;const It=this.messageHandler.sendWithPromise(H,Zt);return bt(this,U).set(H,It),It};class PDFObjects{constructor(){ll(this,K);ll(this,j,Object.create(null))}get(H,Zt=null){if(Zt){const It=nl(this,K,pe).call(this,H);return It.capability.promise.then(()=>Zt(It.data)),null}const at=bt(this,j)[H];if(!(at!=null&&at.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${H}.`);return at.data}has(H){const Zt=bt(this,j)[H];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(H,Zt=null){const at=nl(this,K,pe).call(this,H);at.data=Zt,at.capability.resolve()}clear(){var H;for(const Zt in bt(this,j)){const{data:at}=bt(this,j)[Zt];(H=at==null?void 0:at.bitmap)==null||H.close()}ul(this,j,Object.create(null))}}j=new WeakMap,K=new WeakSet,pe=function(H){var Zt;return(Zt=bt(this,j))[H]||(Zt[H]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(H){ll(this,M,null);ul(this,M,H),this.onContinue=null}get promise(){return bt(this,M).capability.promise}cancel(H=0){bt(this,M).cancel(null,H)}get separateAnnots(){const{separateAnnots:H}=bt(this,M).operatorList;if(!H)return!1;const{annotationCanvasMap:Zt}=bt(this,M);return H.form||H.canvas&&(Zt==null?void 0:Zt.size)>0}}M=new WeakMap,exports.RenderTask=RenderTask;const q=class q{constructor({callback:H,params:Zt,objs:at,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Lt=null}){this.callback=H,this.params=Zt,this.objs=at,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Lt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:H=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(q,u).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bt(q,u).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:at,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(at,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:H,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(H=null,Zt=0){var at;this.running=!1,this.cancelled=!0,(at=this.gfx)==null||at.endDrawing(),bt(q,u).delete(this._canvas),this.callback(H||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var H;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(H=this.stepper)==null||H.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(q,u).delete(this._canvas),this.callback())))}};u=new WeakMap,ll(q,u,new WeakSet);let InternalRenderTask=q;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var p,S,_,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var m=h(1),T=h(4),B=h(8);const v=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=v;class F{constructor(){ll(this,_);ll(this,p,!1);ll(this,S,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(g,I){const C=bt(this,S).get(g);return C===void 0?I:Object.assign(I,C)}getRawValue(g){return bt(this,S).get(g)}remove(g){if(bt(this,S).delete(g),bt(this,S).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const I of bt(this,S).values())if(I instanceof T.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(g,I){const C=bt(this,S).get(g);let j=!1;if(C!==void 0)for(const[K,P]of Object.entries(I))C[K]!==P&&(j=!0,C[K]=P);else j=!0,bt(this,S).set(g,I);j&&nl(this,_,ss).call(this),I instanceof T.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(I.constructor._type)}has(g){return bt(this,S).has(g)}getAll(){return bt(this,S).size>0?(0,m.objectFromMap)(bt(this,S)):null}setAll(g){for(const[I,C]of Object.entries(g))this.setValue(I,C)}get size(){return bt(this,S).size}resetModified(){bt(this,p)&&(ul(this,p,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new J(this)}get serializable(){if(bt(this,S).size===0)return v;const g=new Map,I=new B.MurmurHash3_64,C=[],j=Object.create(null);let K=!1;for(const[P,M]of bt(this,S)){const u=M instanceof T.AnnotationEditor?M.serialize(!1,j):M;u&&(g.set(P,u),I.update(`${P}:${JSON.stringify(u)}`),K||(K=!!u.bitmap))}if(K)for(const P of g.values())P.bitmap&&C.push(P.bitmap);return g.size>0?{map:g,hash:I.hexdigest(),transfers:C}:v}}p=new WeakMap,S=new WeakMap,_=new WeakSet,ss=function(){bt(this,p)||(ul(this,p,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=F;class J extends F{constructor(I){super();ll(this,f,void 0);const{map:C,hash:j,transfers:K}=I.serializable,P=structuredClone(C,K?{transfer:K}:null);ul(this,f,{map:P,hash:j,transfers:K})}get print(){(0,m.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=J},(lt,r,h)=>{var J,p,S,_,U,f,L,g,I,C,j,K,P,M,u,Ye,$,ye,Zt,Te,It,Ve,it,is,zt,cs,Nt,as,Lt,Le,Pt,ds;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var m=h(5),T=h(1),B=h(6);const w=class w{constructor(X){ll(this,u);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Lt);ll(this,Pt);ll(this,J,"");ll(this,p,!1);ll(this,S,null);ll(this,_,null);ll(this,U,null);ll(this,f,!1);ll(this,L,null);ll(this,g,this.focusin.bind(this));ll(this,I,this.focusout.bind(this));ll(this,C,!1);ll(this,j,!1);ll(this,K,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,P,!1);ll(this,M,w._zIndex++);this.constructor===w&&(0,T.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:O,rawDims:{pageWidth:Q,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=O,this.pageRotation=(360+O-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[Q,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,T.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const O=new F({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});O.annotationElementId=X.annotationElementId,O.deleted=!0,O._uiManager.addToAnnotationStorage(O)}static initialize(X,O=null){if(w._l10nPromise||(w._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),O!=null&&O.strings)for(const st of O.strings)w._l10nPromise.set(st,X.get(st));if(w._borderLineWidth!==-1)return;const Q=getComputedStyle(document.documentElement);w._borderLineWidth=parseFloat(Q.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,O){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,O){(0,T.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,P)}set _isDraggable(X){var O;ul(this,P,X),(O=this.div)==null||O.classList.toggle("draggable",X)}center(){const[X,O]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*O/(X*2),this.y+=this.width*X/(O*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*O/(X*2),this.y-=this.width*X/(O*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,M)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,C)?ul(this,C,!1):this.parent.setSelected(this))}focusout(X){var Q;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const O=X.relatedTarget;O!=null&&O.closest(`#${this.id}`)||(X.preventDefault(),(Q=this.parent)!=null&&Q.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,O,Q,st){const[et,Mt]=this.parentDimensions;[Q,st]=this.screenToPageTranslation(Q,st),this.x=(X+Q)/et,this.y=(O+st)/Mt,this.fixAndSetPosition()}translate(X,O){nl(this,u,Ye).call(this,this.parentDimensions,X,O)}translateInPage(X,O){nl(this,u,Ye).call(this,this.pageDimensions,X,O),this.div.scrollIntoView({block:"nearest"})}drag(X,O){const[Q,st]=this.parentDimensions;if(this.x+=X/Q,this.y+=O/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,O]=this.pageDimensions;let{x:Q,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=O,Q*=X,st*=O,this.rotation){case 0:Q=Math.max(0,Math.min(X-et,Q)),st=Math.max(0,Math.min(O-Mt,st));break;case 90:Q=Math.max(0,Math.min(X-Mt,Q)),st=Math.min(O,Math.max(et,st));break;case 180:Q=Math.min(X,Math.max(et,Q)),st=Math.min(O,Math.max(Mt,st));break;case 270:Q=Math.min(X,Math.max(Mt,Q)),st=Math.max(0,Math.min(O-et,st));break}this.x=Q/=X,this.y=st/=O;const[Rt,gt]=nl(this,$,ye).call(this);Q+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*Q).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,O){var Q;return nl(Q=w,Zt,Te).call(Q,X,O,this.parentRotation)}pageTranslationToScreen(X,O){var Q;return nl(Q=w,Zt,Te).call(Q,X,O,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[O,Q]}=this,st=O*X,et=Q*X;return T.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,O){var et;const[Q,st]=this.parentDimensions;this.div.style.width=`${(100*X/Q).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*O/st).toFixed(2)}%`),(et=bt(this,S))==null||et.classList.toggle("small",XQ.stopPropagation()),X.addEventListener("click",Q=>{Q.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",Q=>{Q.target===X&&Q.key==="Enter"&&(Q.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Lt,Le).call(this),this.div.append(X),w.SMALL_EDITOR_SIZE||(w.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,J),decorative:bt(this,p)}}set altTextData({altText:X,decorative:O}){bt(this,J)===X&&bt(this,p)===O||(ul(this,J,X),ul(this,p,O),nl(this,Lt,Le).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,g)),this.div.addEventListener("focusout",bt(this,I));const[X,O]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*O/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/O).toFixed(2)}%`);const[Q,st]=this.getInitialTranslation();return this.translate(Q,st),(0,m.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:O}=T.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&O){X.preventDefault();return}ul(this,C,!0),nl(this,Pt,ds).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,O,Q){X.changeParent(this),this.x=O,this.y=Q,this.fixAndSetPosition()}getRect(X,O){const Q=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/Q,Jt=O/Q,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,O){const[Q,st,et,Mt]=X,Rt=et-Q,gt=Mt-st;switch(this.rotation){case 0:return[Q,O-Mt,Rt,gt];case 90:return[Q,O-st,gt,Rt];case 180:return[et,O-st,Rt,gt];case 270:return[et,O-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,K,!0)}disableEditMode(){ul(this,K,!1)}isInEditMode(){return bt(this,K)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,O;(X=this.div)==null||X.addEventListener("focusin",bt(this,g)),(O=this.div)==null||O.addEventListener("focusout",bt(this,I))}serialize(X=!1,O=null){(0,T.unreachable)("An editor must be serializable")}static deserialize(X,O,Q){const st=new this.prototype.constructor({parent:O,id:O.getNextId(),uiManager:Q});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,g)),this.div.removeEventListener("focusout",bt(this,I)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,S))==null||X.remove(),ul(this,S,null),ul(this,_,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,L).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,O,Q;(X=bt(this,L))==null||X.classList.add("hidden"),(O=this.div)==null||O.classList.remove("selectedEditor"),(Q=this.div)!=null&&Q.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,O){}disableEditing(){bt(this,S)&&(bt(this,S).hidden=!0)}enableEditing(){bt(this,S)&&(bt(this,S).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,j)}set isEditing(X){ul(this,j,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,O){ul(this,f,!0);const Q=X/O,{style:st}=this.div;st.aspectRatio=Q,st.height="auto"}static get MIN_SIZE(){return 16}};J=new WeakMap,p=new WeakMap,S=new WeakMap,_=new WeakMap,U=new WeakMap,f=new WeakMap,L=new WeakMap,g=new WeakMap,I=new WeakMap,C=new WeakMap,j=new WeakMap,K=new WeakMap,P=new WeakMap,M=new WeakMap,u=new WeakSet,Ye=function([X,O],Q,st){[Q,st]=this.screenToPageTranslation(Q,st),this.x+=Q/X,this.y+=st/O,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,O]=this.parentDimensions,{_borderLineWidth:Q}=w,st=Q/X,et=Q/O;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,O,Q){switch(Q){case 90:return[O,-X];case 180:return[-X,-O];case 270:return[-O,X];default:return[X,O]}},It=new WeakSet,Ve=function(X){switch(X){case 90:{const[O,Q]=this.pageDimensions;return[0,-O/Q,Q/O,0]}case 180:return[-1,0,0,-1];case 270:{const[O,Q]=this.pageDimensions;return[0,O/Q,-Q/O,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,L))return;ul(this,L,document.createElement("div")),bt(this,L).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const O of X){const Q=document.createElement("div");bt(this,L).append(Q),Q.classList.add("resizer",O),Q.addEventListener("pointerdown",nl(this,zt,cs).bind(this,O)),Q.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,L))},zt=new WeakSet,cs=function(X,O){O.preventDefault();const{isMac:Q}=T.FeatureTest.platform;if(O.button!==0||O.ctrlKey&&Q)return;const st=nl(this,Nt,as).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(O.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,Yt]=this.parentDimensions;this.setDims(wt*Bt,Yt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,Yt]=this.parentDimensions;this.setDims(wt*Jt,Yt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,as=function(X,O){const[Q,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=w.MIN_SIZE/Q,Dt=w.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Ve).call(this,this.rotation),cl=(Tt,Ct)=>[vt[0]*Tt+vt[2]*Ct,vt[1]*Tt+vt[3]*Ct],bl=nl(this,It,Ve).call(this,360-this.rotation),il=(Tt,Ct)=>[bl[0]*Tt+bl[2]*Ct,bl[1]*Tt+bl[3]*Ct];let Bt,Ft,wt=!1,Yt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,Ct)=>[0,0],Ft=(Tt,Ct)=>[Tt,Ct];break;case"topMiddle":Bt=(Tt,Ct)=>[Tt/2,0],Ft=(Tt,Ct)=>[Tt/2,Ct];break;case"topRight":wt=!0,Bt=(Tt,Ct)=>[Tt,0],Ft=(Tt,Ct)=>[0,Ct];break;case"middleRight":Yt=!0,Bt=(Tt,Ct)=>[Tt,Ct/2],Ft=(Tt,Ct)=>[0,Ct/2];break;case"bottomRight":wt=!0,Bt=(Tt,Ct)=>[Tt,Ct],Ft=(Tt,Ct)=>[0,0];break;case"bottomMiddle":Bt=(Tt,Ct)=>[Tt/2,Ct],Ft=(Tt,Ct)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,Ct)=>[0,Ct],Ft=(Tt,Ct)=>[Tt,0];break;case"middleLeft":Yt=!0,Bt=(Tt,Ct)=>[0,Ct/2],Ft=(Tt,Ct)=>[Tt,Ct/2];break}const jt=Bt(Rt,gt),$t=Ft(Rt,gt);let al=cl(...$t);const Ml=qt(et+al[0]),pl=qt(Mt+al[1]);let Xl=1,Yl=1,[Vl,yl]=this.screenToPageTranslation(O.movementX,O.movementY);if([Vl,yl]=il(Vl/Q,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=Yl=Math.max(Math.min(Math.hypot($t[0]-jt[0]-Vl,$t[1]-jt[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else Yt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-jt[0]-Vl)))/Rt:Yl=Math.max(Dt,Math.min(1,Math.abs($t[1]-jt[1]-yl)))/gt;const Ll=qt(Rt*Xl),_t=qt(gt*Yl);al=cl(...Ft(Ll,_t));const ot=Ml-al[0],ut=pl-al[1];this.width=Ll,this.height=_t,this.x=ot,this.y=ut,this.setDims(Q*Ll,st*_t),this.fixAndSetPosition()},Lt=new WeakSet,Le=async function(){var Q;const X=bt(this,S);if(!X)return;if(!bt(this,J)&&!bt(this,p)){X.classList.remove("done"),(Q=bt(this,_))==null||Q.remove();return}w._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let O=bt(this,_);if(!O){ul(this,_,O=document.createElement("span")),O.className="tooltip",O.setAttribute("role","tooltip");const st=O.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,U,setTimeout(()=>{ul(this,U,null),bt(this,_).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,U)),ul(this,U,null),(Mt=bt(this,_))==null||Mt.classList.remove("show")})}X.classList.add("done"),O.innerText=bt(this,p)?await w._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,J),O.parentNode||X.append(O)},Pt=new WeakSet,ds=function(X){if(!this._isDraggable)return;const O=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let Q,st;O&&(Q={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,Q));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),O&&window.removeEventListener("pointermove",st,Q),ul(this,C,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=T.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(w,Zt),gl(w,"_borderLineWidth",-1),gl(w,"_colorManager",new m.ColorManager),gl(w,"_zIndex",1),gl(w,"SMALL_EDITOR_SIZE",0);let v=w;r.AnnotationEditor=v;class F extends v{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,L,g,I,C,Ie,P,M,u,q,$,ns,at,It,xt,it,Xt,zt,Gt,Nt,Ut,Lt,Ht,Pt,dt,w,k,X,O,Q,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,Yt,jt,Zs,al,ze,pl,Re,Yl,de,yl,Se,_t,we,ut,Jl,Ct,_l,Vt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=v;var m=h(1),T=h(6);function B(nt,R,ct){for(const Wt of ct)R.addEventListener(Wt,nt[Wt].bind(nt))}function v(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class F{constructor(){ll(this,f,0)}getId(){return`${m.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const K=class K{constructor(){ll(this,C);ll(this,L,(0,m.getUuid)());ll(this,g,0);ll(this,I,null)}static get _isSVGFittingCanvas(){const R='data:image/svg+xml;charset=UTF-8,',Wt=new OffscreenCanvas(1,3).getContext("2d"),pt=new Image;pt.src=R;const kt=pt.decode().then(()=>(Wt.drawImage(pt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,m.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(R){const{lastModified:ct,name:Wt,size:pt,type:kt}=R;return nl(this,C,Ie).call(this,`${ct}_${Wt}_${pt}_${kt}`,R)}async getFromUrl(R){return nl(this,C,Ie).call(this,R,R)}async getFromId(R){bt(this,I)||ul(this,I,new Map);const ct=bt(this,I).get(R);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(R){const ct=bt(this,I).get(R);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(R){bt(this,I)||ul(this,I,new Map);const ct=bt(this,I).get(R);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(R){return R.startsWith(`image_${bt(this,L)}_`)}};L=new WeakMap,g=new WeakMap,I=new WeakMap,C=new WeakSet,Ie=async function(R,ct){bt(this,I)||ul(this,I,new Map);let Wt=bt(this,I).get(R);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,L)}_${Al(this,g)._++}`,refCounter:0,isSvg:!1});let pt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);pt=await kt.blob()}else pt=Wt.file=ct;if(pt.type==="image/svg+xml"){const kt=K._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((dl,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,dl()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(pt),await ml}else Wt.bitmap=await createImageBitmap(pt);Wt.refCounter=1}catch(pt){console.error(pt),Wt=null}return bt(this,I).set(R,Wt),Wt&&bt(this,I).set(Wt.id,Wt),Wt};let J=K;class p{constructor(R=128){ll(this,P,[]);ll(this,M,!1);ll(this,u,void 0);ll(this,q,-1);ul(this,u,R)}add({cmd:R,undo:ct,mustExec:Wt,type:pt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&R(),bt(this,M))return;const sl={cmd:R,undo:ct,type:pt};if(bt(this,q)===-1){bt(this,P).length>0&&(bt(this,P).length=0),ul(this,q,0),bt(this,P).push(sl);return}if(kt&&bt(this,P)[bt(this,q)].type===pt){Et&&(sl.undo=bt(this,P)[bt(this,q)].undo),bt(this,P)[bt(this,q)]=sl;return}const ml=bt(this,q)+1;ml===bt(this,u)?bt(this,P).splice(0,1):(ul(this,q,ml),mlkt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(R){const ct=this._colors.get(R);return ct?m.Util.makeHexColor(...ct):R}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let _=Zt;r.ColorManager=_;const Wl=class Wl{constructor(R,ct,Wt,pt,kt,Et){ll(this,jt);ll(this,al);ll(this,pl);ll(this,Yl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,Ct);ll(this,Vt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,at,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new p);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Lt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,dt,new F);ll(this,w,!1);ll(this,k,!1);ll(this,X,null);ll(this,O,m.AnnotationEditorType.NONE);ll(this,Q,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,Yt,null);ul(this,wt,R),ul(this,Yt,ct),ul(this,it,Wt),this._eventBus=pt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:T.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const R=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,pt=this.TRANSLATE_BIG;return(0,m.shadow)(this,"_keyboardManager",new S([[["ctrl+a","mac+meta+a"],R.selectAll],[["ctrl+z","mac+meta+z"],R.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],R.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],R.delete],[["Escape","mac+Escape"],R.unselectAll],[["ArrowLeft","mac+ArrowLeft"],R.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],R.translateSelectedEditors,{args:[-pt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],R.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],R.translateSelectedEditors,{args:[pt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],R.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],R.translateSelectedEditors,{args:[0,-pt],checker:ct}],[["ArrowDown","mac+ArrowDown"],R.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],R.translateSelectedEditors,{args:[0,pt],checker:ct}]]))}destroy(){nl(this,Yl,de).call(this),nl(this,al,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const R of bt(this,xt).values())R.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,at,null),bt(this,Q).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,m.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,m.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(R){var ct;(ct=bt(this,it))==null||ct.editAltText(this,R)}onPageChanging({pageNumber:R}){ul(this,Gt,R-1)}focusMainContainer(){bt(this,wt).focus()}findParent(R,ct){for(const Wt of bt(this,xt).values()){const{x:pt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(R>=pt&&R<=pt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(R=!1){bt(this,Yt).classList.toggle("noUserSelect",R)}addShouldRescale(R){bt(this,Ht).add(R)}removeShouldRescale(R){bt(this,Ht).delete(R)}onScaleChanging({scale:R}){this.commitOrRemove(),this.viewParameters.realScale=R*T.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:R}){this.commitOrRemove(),this.viewParameters.rotation=R}addToAnnotationStorage(R){!R.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(R.id)&&bt(this,Xt).setValue(R.id,R)}blur(){if(!this.hasSelection)return;const{activeElement:R}=document;for(const ct of bt(this,Q))if(ct.div.contains(R)){ul(this,X,[ct,R]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[R,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{R._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,pl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,Yl,de).call(this),nl(this,_t,we).call(this)}copy(R){var Wt;if(R.preventDefault(),(Wt=bt(this,at))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const pt of bt(this,Q)){const kt=pt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&R.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(R){this.copy(R),this.delete()}paste(R){R.preventDefault();const{clipboardData:ct}=R;for(const kt of ct.items)for(const Et of bt(this,Lt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,m.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const pt=this.currentLayer;try{const kt=[];for(const ml of Wt){const dl=pt.deserialize(ml);if(!dl)return;kt.push(dl)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,m.warn)(`paste: "${kt.message}".`)}}keydown(R){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,R)}onEditingAction(R){["undo","redo","delete","selectAll"].includes(R.name)&&this[R.name]()}setEditingState(R){R?(nl(this,jt,Zs).call(this),nl(this,pl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,O)!==m.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,al,ze).call(this),nl(this,Yl,de).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(R){if(!bt(this,Lt)){ul(this,Lt,R);for(const ct of bt(this,Lt))nl(this,Ct,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,dt).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(R){return bt(this,xt).get(R)}get currentPageIndex(){return bt(this,Gt)}addLayer(R){bt(this,xt).set(R.pageIndex,R),bt(this,w)?R.enable():R.disable()}removeLayer(R){bt(this,xt).delete(R.pageIndex)}updateMode(R,ct=null){if(bt(this,O)!==R){if(ul(this,O,R),R===m.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Vt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(R);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(R){R!==bt(this,O)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:R})}updateParams(R,ct){if(bt(this,Lt)){if(R===m.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(R);return}for(const Wt of bt(this,Q))Wt.updateParams(R,ct);for(const Wt of bt(this,Lt))Wt.updateDefaultParams(R,ct)}}enableWaiting(R=!1){if(bt(this,k)!==R){ul(this,k,R);for(const ct of bt(this,xt).values())R?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",R)}}getEditors(R){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===R&&ct.push(Wt);return ct}getEditor(R){return bt(this,It).get(R)}addEditor(R){bt(this,It).set(R.id,R)}removeEditor(R){var ct;bt(this,It).delete(R.id),this.unselect(R),(!R.annotationElementId||!bt(this,Nt).has(R.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(R.id))}addDeletedAnnotationElement(R){bt(this,Nt).add(R.annotationElementId),R.deleted=!0}isDeletedAnnotationElement(R){return bt(this,Nt).has(R)}removeDeletedAnnotationElement(R){bt(this,Nt).delete(R.annotationElementId),R.deleted=!1}setActiveEditor(R){bt(this,at)!==R&&(ul(this,at,R),R&&nl(this,Ct,_l).call(this,R.propertiesToUpdate))}toggleSelected(R){if(bt(this,Q).has(R)){bt(this,Q).delete(R),R.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,Q).add(R),R.select(),nl(this,Ct,_l).call(this,R.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(R){for(const ct of bt(this,Q))ct!==R&&ct.unselect();bt(this,Q).clear(),bt(this,Q).add(R),R.select(),nl(this,Ct,_l).call(this,R.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(R){return bt(this,Q).has(R)}unselect(R){R.unselect(),bt(this,Q).delete(R),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,Q).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(R){bt(this,zt).add(R),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const R=[...bt(this,Q)],ct=()=>{for(const pt of R)pt.remove()},Wt=()=>{for(const pt of R)nl(this,el,xe).call(this,pt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var R;(R=bt(this,at))==null||R.commitOrRemove()}hasSomethingToControl(){return bt(this,at)||this.hasSelection}selectAll(){for(const R of bt(this,Q))R.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,at)){bt(this,at).commitOrRemove();return}if(this.hasSelection){for(const R of bt(this,Q))R.unselect();bt(this,Q).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(R,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=R,bt(this,Bt)[1]+=ct;const[pt,kt]=bt(this,Bt),Et=[...bt(this,Q)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(pt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-pt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(R,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const R of bt(this,Q))bt(this,Ut).set(R,{savedX:R.x,savedY:R.y,savedPageIndex:R.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const R=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:pt,y:kt,pageIndex:Et},sl]of R)sl.newX=pt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=pt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(pt,kt,Et,sl)=>{if(bt(this,It).has(pt.id)){const ml=bt(this,xt).get(sl);ml?pt._setParentAndPosition(ml,kt,Et):(pt.pageIndex=sl,pt.x=kt,pt.y=Et)}};return this.addCommands({cmd:()=>{for(const[pt,{newX:kt,newY:Et,newPageIndex:sl}]of R)Wt(pt,kt,Et,sl)},undo:()=>{for(const[pt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of R)Wt(pt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(R,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(R,ct)}rebuild(R){if(R.parent===null){const ct=this.getLayer(R.pageIndex);ct?(ct.changeParent(R),ct.addOrRebuild(R)):(this.addEditor(R),this.addToAnnotationStorage(R),R.rebuild())}else R.parent.addOrRebuild(R)}isActive(R){return bt(this,at)===R}getActive(){return bt(this,at)}getMode(){return bt(this,O)}get imageManager(){return(0,m.shadow)(this,"imageManager",new J)}};at=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,dt=new WeakMap,w=new WeakMap,k=new WeakMap,X=new WeakMap,O=new WeakMap,Q=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,Yt=new WeakMap,jt=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},al=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},pl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},Yl=new WeakSet,de=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(R){Object.entries(R).some(([Wt,pt])=>bt(this,il)[Wt]!==pt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),R)})},Ct=new WeakSet,_l=function(R){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:R})},Vt=new WeakSet,hs=function(){if(!bt(this,w)){ul(this,w,!0);for(const R of bt(this,xt).values())R.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,w)){ul(this,w,!1);for(const R of bt(this,xt).values())R.disable()}},el=new WeakSet,xe=function(R){const ct=bt(this,xt).get(R.pageIndex);ct?ct.addOrRebuild(R):this.addEditor(R)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const R of bt(this,It).values())return R.isEmpty();return!1},hl=new WeakSet,ke=function(R){bt(this,Q).clear();for(const ct of R)ct.isEmpty()||(bt(this,Q).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let U=Wl;r.AnnotationEditorUIManager=U},(lt,r,h)=>{var Gt,Nt,Ut,Lt,Ht,Pt,dt,w,k,X,O,Q,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=q,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=C,r.getPdfFilenameFromUrl=j,r.getRGB=at,r.getXfaPageViewport=Zt,r.isDataScheme=g,r.isPdfFile=I,r.isValidFetchUrl=P,r.loadScript=u,r.noContextMenu=M,r.setLayerDimensions=Xt;var m=h(7),T=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let v=zt;r.PixelsPerInch=v;class F extends m.BaseFilterFactory{constructor({docId:Yt,ownerDocument:jt=globalThis.document}={}){super();ll(this,Q);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Lt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,dt,void 0);ll(this,w,void 0);ll(this,k,void 0);ll(this,X,void 0);ll(this,O,0);ul(this,Ut,Yt),ul(this,Lt,jt)}addFilter(Yt){if(!Yt)return"none";let jt=bt(this,Q,Pl).get(Yt);if(jt)return jt;let $t,al,Ml,pl;if(Yt.length===1){const yl=Yt[0],Ll=new Array(256);for(let _t=0;_t<256;_t++)Ll[_t]=yl[_t]/255;pl=$t=al=Ml=Ll.join(",")}else{const[yl,Ll,_t]=Yt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let Ct=0;Ct<256;Ct++)ot[Ct]=yl[Ct]/255,ut[Ct]=Ll[Ct]/255,Tt[Ct]=_t[Ct]/255;$t=ot.join(","),al=ut.join(","),Ml=Tt.join(","),pl=`${$t}${al}${Ml}`}if(jt=bt(this,Q,Pl).get(pl),jt)return bt(this,Q,Pl).set(Yt,jt),jt;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,O)._++}`,Yl=`url(#${Xl})`;bt(this,Q,Pl).set(Yt,Yl),bt(this,Q,Pl).set(pl,Yl);const Vl=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,al,Ml,Vl),Yl}addHCMFilter(Yt,jt){var Ll;const $t=`${Yt}-${jt}`;if(bt(this,Pt)===$t)return bt(this,dt);if(ul(this,Pt,$t),ul(this,dt,"none"),(Ll=bt(this,Ht))==null||Ll.remove(),!Yt||!jt)return bt(this,dt);const al=nl(this,il,te).call(this,Yt);Yt=T.Util.makeHexColor(...al);const Ml=nl(this,il,te).call(this,jt);if(jt=T.Util.makeHexColor(...Ml),bt(this,et,Hl).style.color="",Yt==="#000000"&&jt==="#ffffff"||Yt===jt)return bt(this,dt);const pl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;pl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=pl.join(","),Yl=`g_${bt(this,Ut)}_hcm_filter`,Vl=ul(this,w,nl(this,Jt,ne).call(this,Yl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Vl),nl(this,Rt,ge).call(this,Vl);const yl=(_t,ot)=>{const ut=al[_t]/255,Tt=Ml[_t]/255,Ct=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)Ct[Ot]=ut+Ot/ot*(Tt-ut);return Ct.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Vl),ul(this,dt,`url(#${Yl})`),bt(this,dt)}addHighlightHCMFilter(Yt,jt,$t,al){var Tt;const Ml=`${Yt}-${jt}-${$t}-${al}`;if(bt(this,k)===Ml)return bt(this,X);if(ul(this,k,Ml),ul(this,X,"none"),(Tt=bt(this,w))==null||Tt.remove(),!Yt||!jt)return bt(this,X);const[pl,Xl]=[Yt,jt].map(nl(this,il,te).bind(this));let Yl=Math.round(.2126*pl[0]+.7152*pl[1]+.0722*pl[2]),Vl=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Ll]=[$t,al].map(nl(this,il,te).bind(this));Vl{const yt=new Array(256),Kt=(Vl-Yl)/Vt,tl=Ct/255,el=(Ot-Ct)/(255*Vt);let ol=0;for(let Qt=0;Qt<=Vt;Qt++){const rl=Math.round(Yl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=rl;Il++)yt[Il]=hl;ol=rl+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,w,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Ll[0],5),_t(yl[1],Ll[1],5),_t(yl[2],Ll[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(Yt=!1){Yt&&(bt(this,dt)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,O,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,dt=new WeakMap,w=new WeakMap,k=new WeakMap,X=new WeakMap,O=new WeakMap,Q=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const Yt=bt(this,Lt).createElement("div"),{style:jt}=Yt;jt.visibility="hidden",jt.contain="strict",jt.width=jt.height=0,jt.position="absolute",jt.top=jt.left=0,jt.zIndex=-1;const $t=bt(this,Lt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Lt).createElementNS(B,"defs")),Yt.append($t),$t.append(bt(this,Nt)),bt(this,Lt).body.append(Yt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(Yt){const jt=bt(this,Lt).createElementNS(B,"feColorMatrix");jt.setAttribute("type","matrix"),jt.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),Yt.append(jt)},Jt=new WeakSet,ne=function(Yt){const jt=bt(this,Lt).createElementNS(B,"filter");return jt.setAttribute("color-interpolation-filters","sRGB"),jt.setAttribute("id",Yt),bt(this,et,Hl).append(jt),jt},qt=new WeakSet,Ze=function(Yt,jt,$t){const al=bt(this,Lt).createElementNS(B,jt);al.setAttribute("type","discrete"),al.setAttribute("tableValues",$t),Yt.append(al)},cl=new WeakSet,$l=function(Yt,jt,$t,al){const Ml=bt(this,Lt).createElementNS(B,"feComponentTransfer");al.append(Ml),nl(this,qt,Ze).call(this,Ml,"feFuncR",Yt),nl(this,qt,Ze).call(this,Ml,"feFuncG",jt),nl(this,qt,Ze).call(this,Ml,"feFuncB",$t)},il=new WeakSet,te=function(Yt){return bt(this,et,Hl).style.color=Yt,at(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=F;class J extends m.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,Yt){const jt=this._document.createElement("canvas");return jt.width=wt,jt.height=Yt,jt}}r.DOMCanvasFactory=J;async function p(Ft,wt=!1){if(P(Ft,document.baseURI)){const Yt=await fetch(Ft);if(!Yt.ok)throw new Error(Yt.statusText);return wt?new Uint8Array(await Yt.arrayBuffer()):(0,T.stringToBytes)(await Yt.text())}return new Promise((Yt,jt)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let al;if(wt&&$t.response?al=new Uint8Array($t.response):!wt&&$t.responseText&&(al=(0,T.stringToBytes)($t.responseText)),al){Yt(al);return}}jt(new Error($t.statusText))}},$t.send(null)})}class S extends m.BaseCMapReaderFactory{_fetchData(wt,Yt){return p(wt,this.isCompressed).then(jt=>({cMapData:jt,compressionType:Yt}))}}r.DOMCMapReaderFactory=S;class _ extends m.BaseStandardFontDataFactory{_fetchData(wt){return p(wt,!0)}}r.DOMStandardFontDataFactory=_;class U extends m.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=U;class f{constructor({viewBox:wt,scale:Yt,rotation:jt,offsetX:$t=0,offsetY:al=0,dontFlip:Ml=!1}){this.viewBox=wt,this.scale=Yt,this.rotation=jt,this.offsetX=$t,this.offsetY=al;const pl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let Yl,Vl,yl,Ll;switch(jt%=360,jt<0&&(jt+=360),jt){case 180:Yl=-1,Vl=0,yl=0,Ll=1;break;case 90:Yl=0,Vl=1,yl=1,Ll=0;break;case 270:Yl=0,Vl=-1,yl=-1,Ll=0;break;case 0:Yl=1,Vl=0,yl=0,Ll=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ml&&(yl=-yl,Ll=-Ll);let _t,ot,ut,Tt;Yl===0?(_t=Math.abs(Xl-wt[1])*Yt+$t,ot=Math.abs(pl-wt[0])*Yt+al,ut=(wt[3]-wt[1])*Yt,Tt=(wt[2]-wt[0])*Yt):(_t=Math.abs(pl-wt[0])*Yt+$t,ot=Math.abs(Xl-wt[1])*Yt+al,ut=(wt[2]-wt[0])*Yt,Tt=(wt[3]-wt[1])*Yt),this.transform=[Yl*Yt,Vl*Yt,yl*Yt,Ll*Yt,_t-Yl*Yt*pl-yl*Yt*Xl,ot-Vl*Yt*pl-Ll*Yt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,T.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:Yt=this.rotation,offsetX:jt=this.offsetX,offsetY:$t=this.offsetY,dontFlip:al=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:Yt,offsetX:jt,offsetY:$t,dontFlip:al})}convertToViewportPoint(wt,Yt){return T.Util.applyTransform([wt,Yt],this.transform)}convertToViewportRectangle(wt){const Yt=T.Util.applyTransform([wt[0],wt[1]],this.transform),jt=T.Util.applyTransform([wt[2],wt[3]],this.transform);return[Yt[0],Yt[1],jt[0],jt[1]]}convertToPdfPoint(wt,Yt){return T.Util.applyInverseTransform([wt,Yt],this.transform)}}r.PageViewport=f;class L extends T.BaseException{constructor(wt,Yt=0){super(wt,"RenderingCancelledException"),this.extraDelay=Yt}}r.RenderingCancelledException=L;function g(Ft){const wt=Ft.length;let Yt=0;for(;Yt{const $t=document.createElement("script");$t.src=Ft,$t.onload=function(al){wt&&$t.remove(),Yt(al)},$t.onerror=function(){jt(new Error(`Cannot load script at: ${$t.src}`))},(document.head||document.documentElement).append($t)})}function q(Ft){console.log("Deprecated API usage: "+Ft)}let $;class H{static toDateObject(wt){if(!wt||typeof wt!="string")return null;$||($=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const Yt=$.exec(wt);if(!Yt)return null;const jt=parseInt(Yt[1],10);let $t=parseInt(Yt[2],10);$t=$t>=1&&$t<=12?$t-1:0;let al=parseInt(Yt[3],10);al=al>=1&&al<=31?al:1;let Ml=parseInt(Yt[4],10);Ml=Ml>=0&&Ml<=23?Ml:0;let pl=parseInt(Yt[5],10);pl=pl>=0&&pl<=59?pl:0;let Xl=parseInt(Yt[6],10);Xl=Xl>=0&&Xl<=59?Xl:0;const Yl=Yt[7]||"Z";let Vl=parseInt(Yt[8],10);Vl=Vl>=0&&Vl<=23?Vl:0;let yl=parseInt(Yt[9],10)||0;return yl=yl>=0&&yl<=59?yl:0,Yl==="-"?(Ml+=Vl,pl+=yl):Yl==="+"&&(Ml-=Vl,pl-=yl),new Date(Date.UTC(jt,$t,al,Ml,pl,Xl))}}r.PDFDateString=H;function Zt(Ft,{scale:wt=1,rotation:Yt=0}){const{width:jt,height:$t}=Ft.attributes.style,al=[0,0,parseInt(jt),parseInt($t)];return new f({viewBox:al,scale:wt,rotation:Yt})}function at(Ft){if(Ft.startsWith("#")){const wt=parseInt(Ft.slice(1),16);return[(wt&16711680)>>16,(wt&65280)>>8,wt&255]}return Ft.startsWith("rgb(")?Ft.slice(4,-1).split(",").map(wt=>parseInt(wt)):Ft.startsWith("rgba(")?Ft.slice(5,-1).split(",").map(wt=>parseInt(wt)).slice(0,3):((0,T.warn)(`Not a valid color format: "${Ft}"`),[0,0,0])}function It(Ft){const wt=document.createElement("span");wt.style.visibility="hidden",document.body.append(wt);for(const Yt of Ft.keys()){wt.style.color=Yt;const jt=window.getComputedStyle(wt).color;Ft.set(Yt,at(jt))}wt.remove()}function xt(Ft){const{a:wt,b:Yt,c:jt,d:$t,e:al,f:Ml}=Ft.getTransform();return[wt,Yt,jt,$t,al,Ml]}function it(Ft){const{a:wt,b:Yt,c:jt,d:$t,e:al,f:Ml}=Ft.getTransform().invertSelf();return[wt,Yt,jt,$t,al,Ml]}function Xt(Ft,wt,Yt=!1,jt=!0){if(wt instanceof f){const{pageWidth:$t,pageHeight:al}=wt.rawDims,{style:Ml}=Ft,pl=T.FeatureTest.isCSSRoundSupported,Xl=`var(--scale-factor) * ${$t}px`,Yl=`var(--scale-factor) * ${al}px`,Vl=pl?`round(${Xl}, 1px)`:`calc(${Xl})`,yl=pl?`round(${Yl}, 1px)`:`calc(${Yl})`;!Yt||wt.rotation%180===0?(Ml.width=Vl,Ml.height=yl):(Ml.width=yl,Ml.height=Vl)}jt&&Ft.setAttribute("data-main-rotation",wt.rotation)}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseStandardFontDataFactory=r.BaseSVGFactory=r.BaseFilterFactory=r.BaseCanvasFactory=r.BaseCMapReaderFactory=void 0;var m=h(1);class T{constructor(){this.constructor===T&&(0,m.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(S){return"none"}addHCMFilter(S,_){return"none"}addHighlightHCMFilter(S,_,U,f){return"none"}destroy(S=!1){}}r.BaseFilterFactory=T;class B{constructor(){this.constructor===B&&(0,m.unreachable)("Cannot initialize BaseCanvasFactory.")}create(S,_){if(S<=0||_<=0)throw new Error("Invalid canvas size");const U=this._createCanvas(S,_);return{canvas:U,context:U.getContext("2d")}}reset(S,_,U){if(!S.canvas)throw new Error("Canvas is not specified");if(_<=0||U<=0)throw new Error("Invalid canvas size");S.canvas.width=_,S.canvas.height=U}destroy(S){if(!S.canvas)throw new Error("Canvas is not specified");S.canvas.width=0,S.canvas.height=0,S.canvas=null,S.context=null}_createCanvas(S,_){(0,m.unreachable)("Abstract method `_createCanvas` called.")}}r.BaseCanvasFactory=B;class v{constructor({baseUrl:S=null,isCompressed:_=!0}){this.constructor===v&&(0,m.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=S,this.isCompressed=_}async fetch({name:S}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!S)throw new Error("CMap name must be specified.");const _=this.baseUrl+S+(this.isCompressed?".bcmap":""),U=this.isCompressed?m.CMapCompressionType.BINARY:m.CMapCompressionType.NONE;return this._fetchData(_,U).catch(f=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${_}`)})}_fetchData(S,_){(0,m.unreachable)("Abstract method `_fetchData` called.")}}r.BaseCMapReaderFactory=v;class F{constructor({baseUrl:S=null}){this.constructor===F&&(0,m.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=S}async fetch({filename:S}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!S)throw new Error("Font filename must be specified.");const _=`${this.baseUrl}${S}`;return this._fetchData(_).catch(U=>{throw new Error(`Unable to load font data at: ${_}`)})}_fetchData(S){(0,m.unreachable)("Abstract method `_fetchData` called.")}}r.BaseStandardFontDataFactory=F;class J{constructor(){this.constructor===J&&(0,m.unreachable)("Cannot initialize BaseSVGFactory.")}create(S,_,U=!1){if(S<=0||_<=0)throw new Error("Invalid SVG dimensions");const f=this._createSVG("svg:svg");return f.setAttribute("version","1.1"),U||(f.setAttribute("width",`${S}px`),f.setAttribute("height",`${_}px`)),f.setAttribute("preserveAspectRatio","none"),f.setAttribute("viewBox",`0 0 ${S} ${_}`),f}createElement(S){if(typeof S!="string")throw new Error("Invalid SVG element type");return this._createSVG(S)}_createSVG(S){(0,m.unreachable)("Abstract method `_createSVG` called.")}}r.BaseSVGFactory=J},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.MurmurHash3_64=void 0;var m=h(1);const T=3285377520,B=4294901760,v=65535;class F{constructor(p){this.h1=p?p&4294967295:T,this.h2=p?p&4294967295:T}update(p){let S,_;if(typeof p=="string"){S=new Uint8Array(p.length*2),_=0;for(let q=0,$=p.length;q<$;q++){const H=p.charCodeAt(q);H<=255?S[_++]=H:(S[_++]=H>>>8,S[_++]=H&255)}}else if((0,m.isArrayBuffer)(p))S=p.slice(),_=S.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const U=_>>2,f=_-U*4,L=new Uint32Array(S.buffer,0,U);let g=0,I=0,C=this.h1,j=this.h2;const K=3432918353,P=461845907,M=K&v,u=P&v;for(let q=0;q>>17,g=g*P&B|g*u&v,C^=g,C=C<<13|C>>>19,C=C*5+3864292196):(I=L[q],I=I*K&B|I*M&v,I=I<<15|I>>>17,I=I*P&B|I*u&v,j^=I,j=j<<13|j>>>19,j=j*5+3864292196);switch(g=0,f){case 3:g^=S[U*4+2]<<16;case 2:g^=S[U*4+1]<<8;case 1:g^=S[U*4],g=g*K&B|g*M&v,g=g<<15|g>>>17,g=g*P&B|g*u&v,U&1?C^=g:j^=g}this.h1=C,this.h2=j}hexdigest(){let p=this.h1,S=this.h2;return p^=S>>>1,p=p*3981806797&B|p*36045&v,S=S*4283543511&B|((S<<16|p>>>16)*2950163797&B)>>>16,p^=S>>>1,p=p*444984403&B|p*60499&v,S=S*3301882366&B|((S<<16|p>>>16)*3120437893&B)>>>16,p^=S>>>1,(p>>>0).toString(16).padStart(8,"0")+(S>>>0).toString(16).padStart(8,"0")}}r.MurmurHash3_64=F},(lt,r,h)=>{var v;Object.defineProperty(r,"__esModule",{value:!0}),r.FontLoader=r.FontFaceObject=void 0;var m=h(1);class T{constructor({ownerDocument:J=globalThis.document,styleElement:p=null}){ll(this,v,new Set);this._document=J,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(J){this.nativeFontFaces.add(J),this._document.fonts.add(J)}removeNativeFontFace(J){this.nativeFontFaces.delete(J),this._document.fonts.delete(J)}insertRule(J){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const p=this.styleElement.sheet;p.insertRule(J,p.cssRules.length)}clear(){for(const J of this.nativeFontFaces)this._document.fonts.delete(J);this.nativeFontFaces.clear(),bt(this,v).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(J){if(!(!J||bt(this,v).has(J.loadedName))){if((0,m.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:p,src:S,style:_}=J,U=new FontFace(p,S,_);this.addNativeFontFace(U);try{await U.load(),bt(this,v).add(p)}catch{(0,m.warn)(`Cannot load system font: ${J.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(U)}return}(0,m.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(J){if(J.attached||J.missingFile&&!J.systemFontInfo)return;if(J.attached=!0,J.systemFontInfo){await this.loadSystemFont(J.systemFontInfo);return}if(this.isFontLoadingAPISupported){const S=J.createNativeFontFace();if(S){this.addNativeFontFace(S);try{await S.loaded}catch(_){throw(0,m.warn)(`Failed to load font '${S.family}': '${_}'.`),J.disableFontFace=!0,_}}return}const p=J.createFontFaceRule();if(p){if(this.insertRule(p),this.isSyncFontLoadingSupported)return;await new Promise(S=>{const _=this._queueLoadingCallback(S);this._prepareFontLoadEvent(J,_)})}}get isFontLoadingAPISupported(){var p;const J=!!((p=this._document)!=null&&p.fonts);return(0,m.shadow)(this,"isFontLoadingAPISupported",J)}get isSyncFontLoadingSupported(){let J=!1;return(m.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(J=!0),(0,m.shadow)(this,"isSyncFontLoadingSupported",J)}_queueLoadingCallback(J){function p(){for((0,m.assert)(!_.done,"completeRequest() cannot be called twice."),_.done=!0;S.length>0&&S[0].done;){const U=S.shift();setTimeout(U.callback,0)}}const{loadingRequests:S}=this,_={done:!1,complete:p,callback:J};return S.push(_),_}get _loadTestFont(){const J=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,m.shadow)(this,"_loadTestFont",J)}_prepareFontLoadEvent(J,p){function S(at,It){return at.charCodeAt(It)<<24|at.charCodeAt(It+1)<<16|at.charCodeAt(It+2)<<8|at.charCodeAt(It+3)&255}function _(at,It,xt,it){const Xt=at.substring(0,It),zt=at.substring(It+xt);return Xt+it+zt}let U,f;const L=this._document.createElement("canvas");L.width=1,L.height=1;const g=L.getContext("2d");let I=0;function C(at,It){if(++I>30){(0,m.warn)("Load test font never loaded."),It();return}if(g.font="30px "+at,g.fillText(".",0,20),g.getImageData(0,0,1,1).data[3]>0){It();return}setTimeout(C.bind(null,at,It))}const j=`lt${Date.now()}${this.loadTestFontId++}`;let K=this._loadTestFont;K=_(K,976,j.length,j);const M=16,u=1482184792;let q=S(K,M);for(U=0,f=j.length-3;U{Zt.remove(),p.complete()})}}v=new WeakMap,r.FontLoader=T;class B{constructor(J,{isEvalSupported:p=!0,disableFontFace:S=!1,ignoreErrors:_=!1,inspectFont:U=null}){this.compiledGlyphs=Object.create(null);for(const f in J)this[f]=J[f];this.isEvalSupported=p!==!1,this.disableFontFace=S===!0,this.ignoreErrors=_===!0,this._inspectFont=U}createNativeFontFace(){var p;if(!this.data||this.disableFontFace)return null;let J;if(!this.cssFontInfo)J=new FontFace(this.loadedName,this.data,{});else{const S={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(S.style=`oblique ${this.cssFontInfo.italicAngle}deg`),J=new FontFace(this.cssFontInfo.fontFamily,this.data,S)}return(p=this._inspectFont)==null||p.call(this,this),J}createFontFaceRule(){var _;if(!this.data||this.disableFontFace)return null;const J=(0,m.bytesToString)(this.data),p=`url(data:${this.mimetype};base64,${btoa(J)});`;let S;if(!this.cssFontInfo)S=`@font-face {font-family:"${this.loadedName}";src:${p}}`;else{let U=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(U+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),S=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${U}src:${p}}`}return(_=this._inspectFont)==null||_.call(this,this,p),S}getPathGenerator(J,p){if(this.compiledGlyphs[p]!==void 0)return this.compiledGlyphs[p];let S;try{S=J.get(this.loadedName+"_path_"+p)}catch(_){if(!this.ignoreErrors)throw _;return(0,m.warn)(`getPathGenerator - ignoring character: "${_}".`),this.compiledGlyphs[p]=function(U,f){}}if(this.isEvalSupported&&m.FeatureTest.isEvalSupported){const _=[];for(const U of S){const f=U.args!==void 0?U.args.join(","):"";_.push("c.",U.cmd,"(",f,`); `)}return this.compiledGlyphs[p]=new Function("c","size",_.join(""))}return this.compiledGlyphs[p]=function(_,U){for(const f of S)f.cmd==="scale"&&(f.args=[U,-U]),_[f.cmd].apply(_,f.args)}}}r.FontFaceObject=B},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NodeStandardFontDataFactory=r.NodeFilterFactory=r.NodeCanvasFactory=r.NodeCMapReaderFactory=void 0;var m=h(7);h(1);const T=function(p){return new Promise((S,_)=>{require$$5.readFile(p,(f,L)=>{if(f||!L){_(new Error(f));return}S(new Uint8Array(L))})})};class B extends m.BaseFilterFactory{}r.NodeFilterFactory=B;class v extends m.BaseCanvasFactory{_createCanvas(S,_){return require$$5.createCanvas(S,_)}}r.NodeCanvasFactory=v;class F extends m.BaseCMapReaderFactory{_fetchData(S,_){return T(S).then(U=>({cMapData:U,compressionType:_}))}}r.NodeCMapReaderFactory=F;class J extends m.BaseStandardFontDataFactory{_fetchData(S){return T(S)}}r.NodeStandardFontDataFactory=J},(lt,r,h)=>{var Nt,De,Lt,Ce;Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasGraphics=void 0;var m=h(1),T=h(6),B=h(12),v=h(13);const F=16,J=100,p=4096,S=15,_=10,U=1e3,f=16;function L(dt,w){if(dt._removeMirroring)throw new Error("Context is already forwarding operations.");dt.__originalSave=dt.save,dt.__originalRestore=dt.restore,dt.__originalRotate=dt.rotate,dt.__originalScale=dt.scale,dt.__originalTranslate=dt.translate,dt.__originalTransform=dt.transform,dt.__originalSetTransform=dt.setTransform,dt.__originalResetTransform=dt.resetTransform,dt.__originalClip=dt.clip,dt.__originalMoveTo=dt.moveTo,dt.__originalLineTo=dt.lineTo,dt.__originalBezierCurveTo=dt.bezierCurveTo,dt.__originalRect=dt.rect,dt.__originalClosePath=dt.closePath,dt.__originalBeginPath=dt.beginPath,dt._removeMirroring=()=>{dt.save=dt.__originalSave,dt.restore=dt.__originalRestore,dt.rotate=dt.__originalRotate,dt.scale=dt.__originalScale,dt.translate=dt.__originalTranslate,dt.transform=dt.__originalTransform,dt.setTransform=dt.__originalSetTransform,dt.resetTransform=dt.__originalResetTransform,dt.clip=dt.__originalClip,dt.moveTo=dt.__originalMoveTo,dt.lineTo=dt.__originalLineTo,dt.bezierCurveTo=dt.__originalBezierCurveTo,dt.rect=dt.__originalRect,dt.closePath=dt.__originalClosePath,dt.beginPath=dt.__originalBeginPath,delete dt._removeMirroring},dt.save=function(){w.save(),this.__originalSave()},dt.restore=function(){w.restore(),this.__originalRestore()},dt.translate=function(X,O){w.translate(X,O),this.__originalTranslate(X,O)},dt.scale=function(X,O){w.scale(X,O),this.__originalScale(X,O)},dt.transform=function(X,O,Q,st,et,Mt){w.transform(X,O,Q,st,et,Mt),this.__originalTransform(X,O,Q,st,et,Mt)},dt.setTransform=function(X,O,Q,st,et,Mt){w.setTransform(X,O,Q,st,et,Mt),this.__originalSetTransform(X,O,Q,st,et,Mt)},dt.resetTransform=function(){w.resetTransform(),this.__originalResetTransform()},dt.rotate=function(X){w.rotate(X),this.__originalRotate(X)},dt.clip=function(X){w.clip(X),this.__originalClip(X)},dt.moveTo=function(k,X){w.moveTo(k,X),this.__originalMoveTo(k,X)},dt.lineTo=function(k,X){w.lineTo(k,X),this.__originalLineTo(k,X)},dt.bezierCurveTo=function(k,X,O,Q,st,et){w.bezierCurveTo(k,X,O,Q,st,et),this.__originalBezierCurveTo(k,X,O,Q,st,et)},dt.rect=function(k,X,O,Q){w.rect(k,X,O,Q),this.__originalRect(k,X,O,Q)},dt.closePath=function(){w.closePath(),this.__originalClosePath()},dt.beginPath=function(){w.beginPath(),this.__originalBeginPath()}}class g{constructor(w){this.canvasFactory=w,this.cache=Object.create(null)}getCanvas(w,k,X){let O;return this.cache[w]!==void 0?(O=this.cache[w],this.canvasFactory.reset(O,k,X)):(O=this.canvasFactory.create(k,X),this.cache[w]=O),O}delete(w){delete this.cache[w]}clear(){for(const w in this.cache){const k=this.cache[w];this.canvasFactory.destroy(k),delete this.cache[w]}}}function I(dt,w,k,X,O,Q,st,et,Mt,Rt){const[gt,Jt,Dt,qt,vt,cl]=(0,T.getCurrentTransform)(dt);if(Jt===0&&Dt===0){const Bt=st*gt+vt,Ft=Math.round(Bt),wt=et*qt+cl,Yt=Math.round(wt),jt=(st+Mt)*gt+vt,$t=Math.abs(Math.round(jt)-Ft)||1,al=(et+Rt)*qt+cl,Ml=Math.abs(Math.round(al)-Yt)||1;return dt.setTransform(Math.sign(gt),0,0,Math.sign(qt),Ft,Yt),dt.drawImage(w,k,X,O,Q,0,0,$t,Ml),dt.setTransform(gt,Jt,Dt,qt,vt,cl),[$t,Ml]}if(gt===0&&qt===0){const Bt=et*Dt+vt,Ft=Math.round(Bt),wt=st*Jt+cl,Yt=Math.round(wt),jt=(et+Rt)*Dt+vt,$t=Math.abs(Math.round(jt)-Ft)||1,al=(st+Mt)*Jt+cl,Ml=Math.abs(Math.round(al)-Yt)||1;return dt.setTransform(0,Math.sign(Jt),Math.sign(Dt),0,Ft,Yt),dt.drawImage(w,k,X,O,Q,0,0,Ml,$t),dt.setTransform(gt,Jt,Dt,qt,vt,cl),[Ml,$t]}dt.drawImage(w,k,X,O,Q,st,et,Mt,Rt);const bl=Math.hypot(gt,Jt),il=Math.hypot(Dt,qt);return[bl*Mt,il*Rt]}function C(dt){const{width:w,height:k}=dt;if(w>U||k>U)return null;const X=1e3,O=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),Q=w+1;let st=new Uint8Array(Q*(k+1)),et,Mt,Rt;const gt=w+7&-8;let Jt=new Uint8Array(gt*k),Dt=0;for(const il of dt.data){let Bt=128;for(;Bt>0;)Jt[Dt++]=il&Bt?0:255,Bt>>=1}let qt=0;for(Dt=0,Jt[Dt]!==0&&(st[0]=1,++qt),Mt=1;Mt>2)+(Jt[Dt+1]?4:0)+(Jt[Dt-gt+1]?8:0),O[il]&&(st[Rt+Mt]=O[il],++qt),Dt++;if(Jt[Dt-gt]!==Jt[Dt]&&(st[Rt+Mt]=Jt[Dt]?2:4,++qt),qt>X)return null}for(Dt=gt*(k-1),Rt=et*Q,Jt[Dt]!==0&&(st[Rt]=8,++qt),Mt=1;MtX)return null;const vt=new Int32Array([0,Q,-1,0,-Q,0,0,0,1]),cl=new Path2D;for(et=0;qt&&et<=k;et++){let il=et*Q;const Bt=il+w;for(;il>4,st[il]&=wt>>2|wt<<2),cl.lineTo(il%Q,il/Q|0),st[il]||--qt}while(Ft!==il);--et}return Jt=null,st=null,function(il){il.save(),il.scale(1/w,-1/k),il.translate(0,-k),il.fill(cl),il.beginPath(),il.restore()}}class j{constructor(w,k){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=m.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=m.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=m.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,w,k])}clone(){const w=Object.create(this);return w.clipBox=this.clipBox.slice(),w}setCurrentPoint(w,k){this.x=w,this.y=k}updatePathMinMax(w,k,X){[k,X]=m.Util.applyTransform([k,X],w),this.minX=Math.min(this.minX,k),this.minY=Math.min(this.minY,X),this.maxX=Math.max(this.maxX,k),this.maxY=Math.max(this.maxY,X)}updateRectMinMax(w,k){const X=m.Util.applyTransform(k,w),O=m.Util.applyTransform(k.slice(2),w);this.minX=Math.min(this.minX,X[0],O[0]),this.minY=Math.min(this.minY,X[1],O[1]),this.maxX=Math.max(this.maxX,X[0],O[0]),this.maxY=Math.max(this.maxY,X[1],O[1])}updateScalingPathMinMax(w,k){m.Util.scaleMinMax(w,k),this.minX=Math.min(this.minX,k[0]),this.maxX=Math.max(this.maxX,k[1]),this.minY=Math.min(this.minY,k[2]),this.maxY=Math.max(this.maxY,k[3])}updateCurvePathMinMax(w,k,X,O,Q,st,et,Mt,Rt,gt){const Jt=m.Util.bezierBoundingBox(k,X,O,Q,st,et,Mt,Rt);if(gt){gt[0]=Math.min(gt[0],Jt[0],Jt[2]),gt[1]=Math.max(gt[1],Jt[0],Jt[2]),gt[2]=Math.min(gt[2],Jt[1],Jt[3]),gt[3]=Math.max(gt[3],Jt[1],Jt[3]);return}this.updateRectMinMax(w,Jt)}getPathBoundingBox(w=B.PathType.FILL,k=null){const X=[this.minX,this.minY,this.maxX,this.maxY];if(w===B.PathType.STROKE){k||(0,m.unreachable)("Stroke bounding box must include transform.");const O=m.Util.singularValueDecompose2dScale(k),Q=O[0]*this.lineWidth/2,st=O[1]*this.lineWidth/2;X[0]-=Q,X[1]-=st,X[2]+=Q,X[3]+=st}return X}updateClipFromPath(){const w=m.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(w||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(w){this.clipBox=w,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(w=B.PathType.FILL,k=null){return m.Util.intersect(this.clipBox,this.getPathBoundingBox(w,k))}}function K(dt,w){if(typeof ImageData<"u"&&w instanceof ImageData){dt.putImageData(w,0,0);return}const k=w.height,X=w.width,O=k%f,Q=(k-O)/f,st=O===0?Q:Q+1,et=dt.createImageData(X,f);let Mt=0,Rt;const gt=w.data,Jt=et.data;let Dt,qt,vt,cl;if(w.kind===m.ImageKind.GRAYSCALE_1BPP){const bl=gt.byteLength,il=new Uint32Array(Jt.buffer,0,Jt.byteLength>>2),Bt=il.length,Ft=X+7>>3,wt=4294967295,Yt=m.FeatureTest.isLittleEndian?4278190080:255;for(Dt=0;DtFt?X:jt*8-7,Ml=al&-8;let pl=0,Xl=0;for(;$t>=1}for(;Rt=Q&&(vt=O,cl=X*vt),Rt=0,qt=cl;qt--;)Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=255;dt.putImageData(et,0,Dt*f)}else throw new Error(`bad image kind: ${w.kind}`)}function P(dt,w){if(w.bitmap){dt.drawImage(w.bitmap,0,0);return}const k=w.height,X=w.width,O=k%f,Q=(k-O)/f,st=O===0?Q:Q+1,et=dt.createImageData(X,f);let Mt=0;const Rt=w.data,gt=et.data;for(let Jt=0;Jt>8,dt[Q-2]=dt[Q-2]*st+k*et>>8,dt[Q-1]=dt[Q-1]*st+X*et>>8}}}function $(dt,w,k){const X=dt.length,O=1/255;for(let Q=3;Q>8]>>8:w[O]*Q>>16}}function Zt(dt,w,k,X,O,Q,st,et,Mt,Rt,gt){const Jt=!!Q,Dt=Jt?Q[0]:0,qt=Jt?Q[1]:0,vt=Jt?Q[2]:0,cl=O==="Luminosity"?H:$,il=Math.min(X,Math.ceil(1048576/k));for(let Bt=0;Bt_&&typeof X=="function",gt=Rt?Date.now()+S:0;let Jt=0;const Dt=this.commonObjs,qt=this.objs;let vt;for(;;){if(O!==void 0&&et===O.nextBreakPoint)return O.breakIt(et,X),et;if(vt=st[et],vt!==m.OPS.dependency)this[vt].apply(this,Q[et]);else for(const cl of Q[et]){const bl=cl.startsWith("g_")?Dt:qt;if(!bl.has(cl))return bl.get(cl,X),et}if(et++,et===Mt)return et;if(Rt&&++Jt>_){if(Date.now()>gt)return X(),et;Jt=0}}}endDrawing(){nl(this,Nt,De).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const w of this._cachedBitmapsMap.values()){for(const k of w.values())typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement&&(k.width=k.height=0);w.clear()}this._cachedBitmapsMap.clear(),nl(this,Lt,Ce).call(this)}_scaleImage(w,k){const X=w.width,O=w.height;let Q=Math.max(Math.hypot(k[0],k[1]),1),st=Math.max(Math.hypot(k[2],k[3]),1),et=X,Mt=O,Rt="prescale1",gt,Jt;for(;Q>2&&et>1||st>2&&Mt>1;){let Dt=et,qt=Mt;Q>2&&et>1&&(Dt=et>=16384?Math.floor(et/2)-1||1:Math.ceil(et/2),Q/=et/Dt),st>2&&Mt>1&&(qt=Mt>=16384?Math.floor(Mt/2)-1||1:Math.ceil(Mt)/2,st/=Mt/qt),gt=this.cachedCanvases.getCanvas(Rt,Dt,qt),Jt=gt.context,Jt.clearRect(0,0,Dt,qt),Jt.drawImage(w,0,0,et,Mt,0,0,Dt,qt),w=gt.canvas,et=Dt,Mt=qt,Rt=Rt==="prescale1"?"prescale2":"prescale1"}return{img:w,paintWidth:et,paintHeight:Mt}}_createMaskCanvas(w){const k=this.ctx,{width:X,height:O}=w,Q=this.current.fillColor,st=this.current.patternFill,et=(0,T.getCurrentTransform)(k);let Mt,Rt,gt,Jt;if((w.bitmap||w.data)&&w.count>1){const $t=w.bitmap||w.data.buffer;Rt=JSON.stringify(st?et:[et.slice(0,4),Q]),Mt=this._cachedBitmapsMap.get($t),Mt||(Mt=new Map,this._cachedBitmapsMap.set($t,Mt));const al=Mt.get(Rt);if(al&&!st){const Ml=Math.round(Math.min(et[0],et[2])+et[4]),pl=Math.round(Math.min(et[1],et[3])+et[5]);return{canvas:al,offsetX:Ml,offsetY:pl}}gt=al}gt||(Jt=this.cachedCanvases.getCanvas("maskCanvas",X,O),P(Jt.context,w));let Dt=m.Util.transform(et,[1/X,0,0,-1/O,0,0]);Dt=m.Util.transform(Dt,[1,0,0,1,0,-O]);const qt=m.Util.applyTransform([0,0],Dt),vt=m.Util.applyTransform([X,O],Dt),cl=m.Util.normalizeRect([qt[0],qt[1],vt[0],vt[1]]),bl=Math.round(cl[2]-cl[0])||1,il=Math.round(cl[3]-cl[1])||1,Bt=this.cachedCanvases.getCanvas("fillCanvas",bl,il),Ft=Bt.context,wt=Math.min(qt[0],vt[0]),Yt=Math.min(qt[1],vt[1]);Ft.translate(-wt,-Yt),Ft.transform(...Dt),gt||(gt=this._scaleImage(Jt.canvas,(0,T.getCurrentTransformInverse)(Ft)),gt=gt.img,Mt&&st&&Mt.set(Rt,gt)),Ft.imageSmoothingEnabled=It((0,T.getCurrentTransform)(Ft),w.interpolate),I(Ft,gt,0,0,gt.width,gt.height,0,0,X,O),Ft.globalCompositeOperation="source-in";const jt=m.Util.transform((0,T.getCurrentTransformInverse)(Ft),[1,0,0,1,-wt,-Yt]);return Ft.fillStyle=st?Q.getPattern(k,this,jt,B.PathType.FILL):Q,Ft.fillRect(0,0,X,O),Mt&&!st&&(this.cachedCanvases.delete("fillCanvas"),Mt.set(Rt,Bt.canvas)),{canvas:Bt.canvas,offsetX:Math.round(wt),offsetY:Math.round(Yt)}}setLineWidth(w){w!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=w,this.ctx.lineWidth=w}setLineCap(w){this.ctx.lineCap=xt[w]}setLineJoin(w){this.ctx.lineJoin=it[w]}setMiterLimit(w){this.ctx.miterLimit=w}setDash(w,k){const X=this.ctx;X.setLineDash!==void 0&&(X.setLineDash(w),X.lineDashOffset=k)}setRenderingIntent(w){}setFlatness(w){}setGState(w){for(const[k,X]of w)switch(k){case"LW":this.setLineWidth(X);break;case"LC":this.setLineCap(X);break;case"LJ":this.setLineJoin(X);break;case"ML":this.setMiterLimit(X);break;case"D":this.setDash(X[0],X[1]);break;case"RI":this.setRenderingIntent(X);break;case"FL":this.setFlatness(X);break;case"Font":this.setFont(X[0],X[1]);break;case"CA":this.current.strokeAlpha=X;break;case"ca":this.current.fillAlpha=X,this.ctx.globalAlpha=X;break;case"BM":this.ctx.globalCompositeOperation=X;break;case"SMask":this.current.activeSMask=X?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(X);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const w=this.inSMaskMode;this.current.activeSMask&&!w?this.beginSMaskMode():!this.current.activeSMask&&w&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const w=this.ctx.canvas.width,k=this.ctx.canvas.height,X="smaskGroupAt"+this.groupLevel,O=this.cachedCanvases.getCanvas(X,w,k);this.suspendedCtx=this.ctx,this.ctx=O.context;const Q=this.ctx;Q.setTransform(...(0,T.getCurrentTransform)(this.suspendedCtx)),M(this.suspendedCtx,Q),L(Q,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),M(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(w){if(!this.current.activeSMask)return;w?(w[0]=Math.floor(w[0]),w[1]=Math.floor(w[1]),w[2]=Math.ceil(w[2]),w[3]=Math.ceil(w[3])):w=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const k=this.current.activeSMask,X=this.suspendedCtx;at(X,k,this.ctx,w),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(M(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const w=this.current;this.stateStack.push(w),this.current=w.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),M(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(w,k,X,O,Q,st){this.ctx.transform(w,k,X,O,Q,st),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(w,k,X){const O=this.ctx,Q=this.current;let st=Q.x,et=Q.y,Mt,Rt;const gt=(0,T.getCurrentTransform)(O),Jt=gt[0]===0&>[3]===0||gt[1]===0&>[2]===0,Dt=Jt?X.slice(0):null;for(let qt=0,vt=0,cl=w.length;qtJ&&(Rt=J),this.current.fontSizeScale=k/Rt,this.ctx.font=`${Mt} ${et} ${Rt}px ${st}`}setTextRenderingMode(w){this.current.textRenderingMode=w}setTextRise(w){this.current.textRise=w}moveText(w,k){this.current.x=this.current.lineX+=w,this.current.y=this.current.lineY+=k}setLeadingMoveText(w,k){this.setLeading(-k),this.moveText(w,k)}setTextMatrix(w,k,X,O,Q,st){this.current.textMatrix=[w,k,X,O,Q,st],this.current.textMatrixScale=Math.hypot(w,k),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(w,k,X,O){const Q=this.ctx,st=this.current,et=st.font,Mt=st.textRenderingMode,Rt=st.fontSize/st.fontSizeScale,gt=Mt&m.TextRenderingMode.FILL_STROKE_MASK,Jt=!!(Mt&m.TextRenderingMode.ADD_TO_PATH_FLAG),Dt=st.patternFill&&!et.missingFile;let qt;(et.disableFontFace||Jt||Dt)&&(qt=et.getPathGenerator(this.commonObjs,w)),et.disableFontFace||Dt?(Q.save(),Q.translate(k,X),Q.beginPath(),qt(Q,Rt),O&&Q.setTransform(...O),(gt===m.TextRenderingMode.FILL||gt===m.TextRenderingMode.FILL_STROKE)&&Q.fill(),(gt===m.TextRenderingMode.STROKE||gt===m.TextRenderingMode.FILL_STROKE)&&Q.stroke(),Q.restore()):((gt===m.TextRenderingMode.FILL||gt===m.TextRenderingMode.FILL_STROKE)&&Q.fillText(w,k,X),(gt===m.TextRenderingMode.STROKE||gt===m.TextRenderingMode.FILL_STROKE)&&Q.strokeText(w,k,X)),Jt&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,T.getCurrentTransform)(Q),x:k,y:X,fontSize:Rt,addToPath:qt})}get isFontSubpixelAAEnabled(){const{context:w}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);w.scale(1.5,1),w.fillText("I",0,10);const k=w.getImageData(0,0,10,10).data;let X=!1;for(let O=3;O0&&k[O]<255){X=!0;break}return(0,m.shadow)(this,"isFontSubpixelAAEnabled",X)}showText(w){const k=this.current,X=k.font;if(X.isType3Font)return this.showType3Text(w);const O=k.fontSize;if(O===0)return;const Q=this.ctx,st=k.fontSizeScale,et=k.charSpacing,Mt=k.wordSpacing,Rt=k.fontDirection,gt=k.textHScale*Rt,Jt=w.length,Dt=X.vertical,qt=Dt?1:-1,vt=X.defaultVMetrics,cl=O*k.fontMatrix[0],bl=k.textRenderingMode===m.TextRenderingMode.FILL&&!X.disableFontFace&&!k.patternFill;Q.save(),Q.transform(...k.textMatrix),Q.translate(k.x,k.y+k.textRise),Rt>0?Q.scale(gt,-1):Q.scale(gt,1);let il;if(k.patternFill){Q.save();const jt=k.fillColor.getPattern(Q,this,(0,T.getCurrentTransformInverse)(Q),B.PathType.FILL);il=(0,T.getCurrentTransform)(Q),Q.restore(),Q.fillStyle=jt}let Bt=k.lineWidth;const Ft=k.textMatrixScale;if(Ft===0||Bt===0){const jt=k.textRenderingMode&m.TextRenderingMode.FILL_STROKE_MASK;(jt===m.TextRenderingMode.STROKE||jt===m.TextRenderingMode.FILL_STROKE)&&(Bt=this.getSinglePixelWidth())}else Bt/=Ft;if(st!==1&&(Q.scale(st,st),Bt/=st),Q.lineWidth=Bt,X.isInvalidPDFjsFont){const jt=[];let $t=0;for(const al of w)jt.push(al.unicode),$t+=al.width;Q.fillText(jt.join(""),0,0),k.x+=$t*cl*gt,Q.restore(),this.compose();return}let wt=0,Yt;for(Yt=0;Yt0){const Ll=Q.measureText(Ml).width*1e3/O*st;if(Vlnew Pt(st,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};k=new B.TilingPattern(w,X,this.ctx,Q,O)}else k=this._getPattern(w[1],w[2]);return k}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(w,k,X){const O=m.Util.makeHexColor(w,k,X);this.ctx.strokeStyle=O,this.current.strokeColor=O}setFillRGBColor(w,k,X){const O=m.Util.makeHexColor(w,k,X);this.ctx.fillStyle=O,this.current.fillColor=O,this.current.patternFill=!1}_getPattern(w,k=null){let X;return this.cachedPatterns.has(w)?X=this.cachedPatterns.get(w):(X=(0,B.getShadingPattern)(this.getObject(w)),this.cachedPatterns.set(w,X)),k&&(X.matrix=k),X}shadingFill(w){if(!this.contentVisible)return;const k=this.ctx;this.save();const X=this._getPattern(w);k.fillStyle=X.getPattern(k,this,(0,T.getCurrentTransformInverse)(k),B.PathType.SHADING);const O=(0,T.getCurrentTransformInverse)(k);if(O){const{width:Q,height:st}=k.canvas,[et,Mt,Rt,gt]=m.Util.getAxialAlignedBoundingBox([0,0,Q,st],O);this.ctx.fillRect(et,Mt,Rt-et,gt-Mt)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,m.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,m.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(w,k){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(w)&&w.length===6&&this.transform(...w),this.baseTransform=(0,T.getCurrentTransform)(this.ctx),k)){const X=k[2]-k[0],O=k[3]-k[1];this.ctx.rect(k[0],k[1],X,O),this.current.updateRectMinMax((0,T.getCurrentTransform)(this.ctx),k),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(w){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const k=this.ctx;w.isolated||(0,m.info)("TODO: Support non-isolated groups."),w.knockout&&(0,m.warn)("Knockout groups not supported.");const X=(0,T.getCurrentTransform)(k);if(w.matrix&&k.transform(...w.matrix),!w.bbox)throw new Error("Bounding box is required.");let O=m.Util.getAxialAlignedBoundingBox(w.bbox,(0,T.getCurrentTransform)(k));const Q=[0,0,k.canvas.width,k.canvas.height];O=m.Util.intersect(O,Q)||[0,0,0,0];const st=Math.floor(O[0]),et=Math.floor(O[1]);let Mt=Math.max(Math.ceil(O[2])-st,1),Rt=Math.max(Math.ceil(O[3])-et,1),gt=1,Jt=1;Mt>p&&(gt=Mt/p,Mt=p),Rt>p&&(Jt=Rt/p,Rt=p),this.current.startNewPathAndClipBox([0,0,Mt,Rt]);let Dt="groupAt"+this.groupLevel;w.smask&&(Dt+="_smask_"+this.smaskCounter++%2);const qt=this.cachedCanvases.getCanvas(Dt,Mt,Rt),vt=qt.context;vt.scale(1/gt,1/Jt),vt.translate(-st,-et),vt.transform(...X),w.smask?this.smaskStack.push({canvas:qt.canvas,context:vt,offsetX:st,offsetY:et,scaleX:gt,scaleY:Jt,subtype:w.smask.subtype,backdrop:w.smask.backdrop,transferMap:w.smask.transferMap||null,startTransformInverse:null}):(k.setTransform(1,0,0,1,0,0),k.translate(st,et),k.scale(gt,Jt),k.save()),M(k,vt),this.ctx=vt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(k),this.groupLevel++}endGroup(w){if(!this.contentVisible)return;this.groupLevel--;const k=this.ctx,X=this.groupStack.pop();if(this.ctx=X,this.ctx.imageSmoothingEnabled=!1,w.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const O=(0,T.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...O);const Q=m.Util.getAxialAlignedBoundingBox([0,0,k.canvas.width,k.canvas.height],O);this.ctx.drawImage(k.canvas,0,0),this.ctx.restore(),this.compose(Q)}}beginAnnotation(w,k,X,O,Q){if(nl(this,Nt,De).call(this),u(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(k)&&k.length===4){const st=k[2]-k[0],et=k[3]-k[1];if(Q&&this.annotationCanvasMap){X=X.slice(),X[4]-=k[0],X[5]-=k[1],k=k.slice(),k[0]=k[1]=0,k[2]=st,k[3]=et;const[Mt,Rt]=m.Util.singularValueDecompose2dScale((0,T.getCurrentTransform)(this.ctx)),{viewportScale:gt}=this,Jt=Math.ceil(st*this.outputScaleX*gt),Dt=Math.ceil(et*this.outputScaleY*gt);this.annotationCanvas=this.canvasFactory.create(Jt,Dt);const{canvas:qt,context:vt}=this.annotationCanvas;this.annotationCanvasMap.set(w,qt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=vt,this.ctx.save(),this.ctx.setTransform(Mt,0,0,-Rt,0,et*Rt),u(this.ctx)}else u(this.ctx),this.ctx.rect(k[0],k[1],st,et),this.ctx.clip(),this.endPath()}this.current=new j(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...X),this.transform(...O)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),nl(this,Lt,Ce).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(w){if(!this.contentVisible)return;const k=w.count;w=this.getObject(w.data,w),w.count=k;const X=this.ctx,O=this.processingType3;if(O&&(O.compiled===void 0&&(O.compiled=C(w)),O.compiled)){O.compiled(X);return}const Q=this._createMaskCanvas(w),st=Q.canvas;X.save(),X.setTransform(1,0,0,1,0,0),X.drawImage(st,Q.offsetX,Q.offsetY),X.restore(),this.compose()}paintImageMaskXObjectRepeat(w,k,X=0,O=0,Q,st){if(!this.contentVisible)return;w=this.getObject(w.data,w);const et=this.ctx;et.save();const Mt=(0,T.getCurrentTransform)(et);et.transform(k,X,O,Q,0,0);const Rt=this._createMaskCanvas(w);et.setTransform(1,0,0,1,Rt.offsetX-Mt[4],Rt.offsetY-Mt[5]);for(let gt=0,Jt=st.length;gtJt?gt/Jt:1,et=Rt>Jt?Rt/Jt:1}}this._cachedScaleForStroking[0]=st,this._cachedScaleForStroking[1]=et}return this._cachedScaleForStroking}rescaleAndStroke(w){const{ctx:k}=this,{lineWidth:X}=this.current,[O,Q]=this.getScaleForStroking();if(k.lineWidth=X||1,O===1&&Q===1){k.stroke();return}const st=k.getLineDash();if(w&&k.save(),k.scale(O,Q),st.length>0){const et=Math.max(O,Q);k.setLineDash(st.map(Mt=>Mt/et)),k.lineDashOffset/=et}k.stroke(),w&&k.restore()}isContentVisible(){for(let w=this.markedContentStack.length-1;w>=0;w--)if(!this.markedContentStack[w].visible)return!1;return!0}};Nt=new WeakSet,De=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Lt=new WeakSet,Ce=function(){if(this.pageColors){const w=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(w!=="none"){const k=this.ctx.filter;this.ctx.filter=w,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=k}}};let Gt=Pt;r.CanvasGraphics=Gt;for(const dt in m.OPS)Gt.prototype[dt]!==void 0&&(Gt.prototype[m.OPS[dt]]=Gt.prototype[dt])},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TilingPattern=r.PathType=void 0,r.getShadingPattern=f;var m=h(1),T=h(6);const B={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r.PathType=B;function v(C,j){if(!j)return;const K=j[2]-j[0],P=j[3]-j[1],M=new Path2D;M.rect(j[0],j[1],K,P),C.clip(M)}class F{constructor(){this.constructor===F&&(0,m.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,m.unreachable)("Abstract method `getPattern` called.")}}class J extends F{constructor(j){super(),this._type=j[1],this._bbox=j[2],this._colorStops=j[3],this._p0=j[4],this._p1=j[5],this._r0=j[6],this._r1=j[7],this.matrix=null}_createGradient(j){let K;this._type==="axial"?K=j.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(K=j.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const P of this._colorStops)K.addColorStop(P[0],P[1]);return K}getPattern(j,K,P,M){let u;if(M===B.STROKE||M===B.FILL){const q=K.current.getClippedPathBoundingBox(M,(0,T.getCurrentTransform)(j))||[0,0,0,0],$=Math.ceil(q[2]-q[0])||1,H=Math.ceil(q[3]-q[1])||1,Zt=K.cachedCanvases.getCanvas("pattern",$,H,!0),at=Zt.context;at.clearRect(0,0,at.canvas.width,at.canvas.height),at.beginPath(),at.rect(0,0,at.canvas.width,at.canvas.height),at.translate(-q[0],-q[1]),P=m.Util.transform(P,[1,0,0,1,q[0],q[1]]),at.transform(...K.baseTransform),this.matrix&&at.transform(...this.matrix),v(at,this._bbox),at.fillStyle=this._createGradient(at),at.fill(),u=j.createPattern(Zt.canvas,"no-repeat");const It=new DOMMatrix(P);u.setTransform(It)}else v(j,this._bbox),u=this._createGradient(j);return u}}function p(C,j,K,P,M,u,q,$){const H=j.coords,Zt=j.colors,at=C.data,It=C.width*4;let xt;H[K+1]>H[P+1]&&(xt=K,K=P,P=xt,xt=u,u=q,q=xt),H[P+1]>H[M+1]&&(xt=P,P=M,M=xt,xt=q,q=$,$=xt),H[K+1]>H[P+1]&&(xt=K,K=P,P=xt,xt=u,u=q,q=xt);const it=(H[K]+j.offsetX)*j.scaleX,Xt=(H[K+1]+j.offsetY)*j.scaleY,zt=(H[P]+j.offsetX)*j.scaleX,Gt=(H[P+1]+j.offsetY)*j.scaleY,Nt=(H[M]+j.offsetX)*j.scaleX,Ut=(H[M+1]+j.offsetY)*j.scaleY;if(Xt>=Ut)return;const Lt=Zt[u],Ht=Zt[u+1],Pt=Zt[u+2],dt=Zt[q],w=Zt[q+1],k=Zt[q+2],X=Zt[$],O=Zt[$+1],Q=Zt[$+2],st=Math.round(Xt),et=Math.round(Ut);let Mt,Rt,gt,Jt,Dt,qt,vt,cl;for(let bl=st;bl<=et;bl++){if(blUt?Yt=1:Gt===Ut?Yt=0:Yt=(Gt-bl)/(Gt-Ut),Mt=zt-(zt-Nt)*Yt,Rt=dt-(dt-X)*Yt,gt=w-(w-O)*Yt,Jt=k-(k-Q)*Yt}let il;blUt?il=1:il=(Xt-bl)/(Xt-Ut),Dt=it-(it-Nt)*il,qt=Lt-(Lt-X)*il,vt=Ht-(Ht-O)*il,cl=Pt-(Pt-Q)*il;const Bt=Math.round(Math.min(Mt,Dt)),Ft=Math.round(Math.max(Mt,Dt));let wt=It*bl+Bt*4;for(let Yt=Bt;Yt<=Ft;Yt++)il=(Mt-Yt)/(Mt-Dt),il<0?il=0:il>1&&(il=1),at[wt++]=Rt-(Rt-qt)*il|0,at[wt++]=gt-(gt-vt)*il|0,at[wt++]=Jt-(Jt-cl)*il|0,at[wt++]=255}}function S(C,j,K){const P=j.coords,M=j.colors;let u,q;switch(j.type){case"lattice":const $=j.verticesPerRow,H=Math.floor(P.length/$)-1,Zt=$-1;for(u=0;u=M?u=M:P=u/j,{scale:P,size:u}}clipBbox(j,K,P,M,u){const q=M-K,$=u-P;j.ctx.rect(K,P,q,$),j.current.updateRectMinMax((0,T.getCurrentTransform)(j.ctx),[K,P,M,u]),j.clip(),j.endPath()}setFillAndStrokeStyleToContext(j,K,P){const M=j.ctx,u=j.current;switch(K){case L.COLORED:const q=this.ctx;M.fillStyle=q.fillStyle,M.strokeStyle=q.strokeStyle,u.fillColor=q.fillStyle,u.strokeColor=q.strokeStyle;break;case L.UNCOLORED:const $=m.Util.makeHexColor(P[0],P[1],P[2]);M.fillStyle=$,M.strokeStyle=$,u.fillColor=$,u.strokeColor=$;break;default:throw new m.FormatError(`Unsupported paint type: ${K}`)}}getPattern(j,K,P,M){let u=P;M!==B.SHADING&&(u=m.Util.transform(u,K.baseTransform),this.matrix&&(u=m.Util.transform(u,this.matrix)));const q=this.createPatternCanvas(K);let $=new DOMMatrix(u);$=$.translate(q.offsetX,q.offsetY),$=$.scale(1/q.scaleX,1/q.scaleY);const H=j.createPattern(q.canvas,"repeat");return H.setTransform($),H}};gl(I,"MAX_PATTERN_SIZE",3e3);let g=I;r.TilingPattern=g},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.convertBlackAndWhiteToRGBA=B,r.convertToRGBA=T,r.grayToRGBA=F;var m=h(1);function T(J){switch(J.kind){case m.ImageKind.GRAYSCALE_1BPP:return B(J);case m.ImageKind.RGB_24BPP:return v(J)}return null}function B({src:J,srcPos:p=0,dest:S,width:_,height:U,nonBlackColor:f=4294967295,inverseDecode:L=!1}){const g=m.FeatureTest.isLittleEndian?4278190080:255,[I,C]=L?[f,g]:[g,f],j=_>>3,K=_&7,P=J.length;S=new Uint32Array(S.buffer);let M=0;for(let u=0;u>2,I=new Uint32Array(J.buffer,p,g);if(m.FeatureTest.isLittleEndian){for(;L>>24|j<<8|4278190080,S[_+2]=j>>>16|K<<16|4278190080,S[_+3]=K>>>8|4278190080}for(let C=L*4,j=J.length;C>>8|255,S[_+2]=j<<16|K>>>16|255,S[_+3]=K<<8|255}for(let C=L*4,j=J.length;C{Object.defineProperty(r,"__esModule",{value:!0}),r.GlobalWorkerOptions=void 0;const h=Object.create(null);r.GlobalWorkerOptions=h,h.workerPort=null,h.workerSrc=""},(lt,r,h)=>{var J,os,S,ms,U,he;Object.defineProperty(r,"__esModule",{value:!0}),r.MessageHandler=void 0;var m=h(1);const T={UNKNOWN:0,DATA:1,ERROR:2},B={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function v(L){switch(L instanceof Error||typeof L=="object"&&L!==null||(0,m.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),L.name){case"AbortException":return new m.AbortException(L.message);case"MissingPDFException":return new m.MissingPDFException(L.message);case"PasswordException":return new m.PasswordException(L.message,L.code);case"UnexpectedResponseException":return new m.UnexpectedResponseException(L.message,L.status);case"UnknownErrorException":return new m.UnknownErrorException(L.message,L.details);default:return new m.UnknownErrorException(L.message,L.toString())}}class F{constructor(g,I,C){ll(this,J);ll(this,S);ll(this,U);this.sourceName=g,this.targetName=I,this.comObj=C,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=j=>{const K=j.data;if(K.targetName!==this.sourceName)return;if(K.stream){nl(this,S,ms).call(this,K);return}if(K.callback){const M=K.callbackId,u=this.callbackCapabilities[M];if(!u)throw new Error(`Cannot resolve callback ${M}`);if(delete this.callbackCapabilities[M],K.callback===T.DATA)u.resolve(K.data);else if(K.callback===T.ERROR)u.reject(v(K.reason));else throw new Error("Unexpected callback case");return}const P=this.actionHandler[K.action];if(!P)throw new Error(`Unknown action from worker: ${K.action}`);if(K.callbackId){const M=this.sourceName,u=K.sourceName;new Promise(function(q){q(P(K.data))}).then(function(q){C.postMessage({sourceName:M,targetName:u,callback:T.DATA,callbackId:K.callbackId,data:q})},function(q){C.postMessage({sourceName:M,targetName:u,callback:T.ERROR,callbackId:K.callbackId,reason:v(q)})});return}if(K.streamId){nl(this,J,os).call(this,K);return}P(K.data)},C.addEventListener("message",this._onComObjOnMessage)}on(g,I){const C=this.actionHandler;if(C[g])throw new Error(`There is already an actionName called "${g}"`);C[g]=I}send(g,I,C){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:g,data:I},C)}sendWithPromise(g,I,C){const j=this.callbackId++,K=new m.PromiseCapability;this.callbackCapabilities[j]=K;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:g,callbackId:j,data:I},C)}catch(P){K.reject(P)}return K.promise}sendWithStream(g,I,C,j){const K=this.streamId++,P=this.sourceName,M=this.targetName,u=this.comObj;return new ReadableStream({start:q=>{const $=new m.PromiseCapability;return this.streamControllers[K]={controller:q,startCall:$,pullCall:null,cancelCall:null,isClosed:!1},u.postMessage({sourceName:P,targetName:M,action:g,streamId:K,data:I,desiredSize:q.desiredSize},j),$.promise},pull:q=>{const $=new m.PromiseCapability;return this.streamControllers[K].pullCall=$,u.postMessage({sourceName:P,targetName:M,stream:B.PULL,streamId:K,desiredSize:q.desiredSize}),$.promise},cancel:q=>{(0,m.assert)(q instanceof Error,"cancel must have a valid reason");const $=new m.PromiseCapability;return this.streamControllers[K].cancelCall=$,this.streamControllers[K].isClosed=!0,u.postMessage({sourceName:P,targetName:M,stream:B.CANCEL,streamId:K,reason:v(q)}),$.promise}},C)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}J=new WeakSet,os=function(g){const I=g.streamId,C=this.sourceName,j=g.sourceName,K=this.comObj,P=this,M=this.actionHandler[g.action],u={enqueue(q,$=1,H){if(this.isCancelled)return;const Zt=this.desiredSize;this.desiredSize-=$,Zt>0&&this.desiredSize<=0&&(this.sinkCapability=new m.PromiseCapability,this.ready=this.sinkCapability.promise),K.postMessage({sourceName:C,targetName:j,stream:B.ENQUEUE,streamId:I,chunk:q},H)},close(){this.isCancelled||(this.isCancelled=!0,K.postMessage({sourceName:C,targetName:j,stream:B.CLOSE,streamId:I}),delete P.streamSinks[I])},error(q){(0,m.assert)(q instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,K.postMessage({sourceName:C,targetName:j,stream:B.ERROR,streamId:I,reason:v(q)}))},sinkCapability:new m.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:g.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[I]=u,new Promise(function(q){q(M(g.data,u))}).then(function(){K.postMessage({sourceName:C,targetName:j,stream:B.START_COMPLETE,streamId:I,success:!0})},function(q){K.postMessage({sourceName:C,targetName:j,stream:B.START_COMPLETE,streamId:I,reason:v(q)})})},S=new WeakSet,ms=function(g){const I=g.streamId,C=this.sourceName,j=g.sourceName,K=this.comObj,P=this.streamControllers[I],M=this.streamSinks[I];switch(g.stream){case B.START_COMPLETE:g.success?P.startCall.resolve():P.startCall.reject(v(g.reason));break;case B.PULL_COMPLETE:g.success?P.pullCall.resolve():P.pullCall.reject(v(g.reason));break;case B.PULL:if(!M){K.postMessage({sourceName:C,targetName:j,stream:B.PULL_COMPLETE,streamId:I,success:!0});break}M.desiredSize<=0&&g.desiredSize>0&&M.sinkCapability.resolve(),M.desiredSize=g.desiredSize,new Promise(function(u){var q;u((q=M.onPull)==null?void 0:q.call(M))}).then(function(){K.postMessage({sourceName:C,targetName:j,stream:B.PULL_COMPLETE,streamId:I,success:!0})},function(u){K.postMessage({sourceName:C,targetName:j,stream:B.PULL_COMPLETE,streamId:I,reason:v(u)})});break;case B.ENQUEUE:if((0,m.assert)(P,"enqueue should have stream controller"),P.isClosed)break;P.controller.enqueue(g.chunk);break;case B.CLOSE:if((0,m.assert)(P,"close should have stream controller"),P.isClosed)break;P.isClosed=!0,P.controller.close(),nl(this,U,he).call(this,P,I);break;case B.ERROR:(0,m.assert)(P,"error should have stream controller"),P.controller.error(v(g.reason)),nl(this,U,he).call(this,P,I);break;case B.CANCEL_COMPLETE:g.success?P.cancelCall.resolve():P.cancelCall.reject(v(g.reason)),nl(this,U,he).call(this,P,I);break;case B.CANCEL:if(!M)break;new Promise(function(u){var q;u((q=M.onCancel)==null?void 0:q.call(M,v(g.reason)))}).then(function(){K.postMessage({sourceName:C,targetName:j,stream:B.CANCEL_COMPLETE,streamId:I,success:!0})},function(u){K.postMessage({sourceName:C,targetName:j,stream:B.CANCEL_COMPLETE,streamId:I,reason:v(u)})}),M.sinkCapability.reject(v(g.reason)),M.isCancelled=!0,delete this.streamSinks[I];break;default:throw new Error("Unexpected stream case")}},U=new WeakSet,he=async function(g,I){var C,j,K;await Promise.allSettled([(C=g.startCall)==null?void 0:C.promise,(j=g.pullCall)==null?void 0:j.promise,(K=g.cancelCall)==null?void 0:K.promise]),delete this.streamControllers[I]},r.MessageHandler=F},(lt,r,h)=>{var B,v;Object.defineProperty(r,"__esModule",{value:!0}),r.Metadata=void 0;var m=h(1);class T{constructor({parsedData:J,rawData:p}){ll(this,B,void 0);ll(this,v,void 0);ul(this,B,J),ul(this,v,p)}getRaw(){return bt(this,v)}get(J){return bt(this,B).get(J)??null}getAll(){return(0,m.objectFromMap)(bt(this,B))}has(J){return bt(this,B).has(J)}}B=new WeakMap,v=new WeakMap,r.Metadata=T},(lt,r,h)=>{var J,p,S,_,U,f,je;Object.defineProperty(r,"__esModule",{value:!0}),r.OptionalContentConfig=void 0;var m=h(1),T=h(8);const B=Symbol("INTERNAL");class v{constructor(I,C){ll(this,J,!0);this.name=I,this.intent=C}get visible(){return bt(this,J)}_setVisible(I,C){I!==B&&(0,m.unreachable)("Internal method `_setVisible` called."),ul(this,J,C)}}J=new WeakMap;class F{constructor(I){ll(this,f);ll(this,p,null);ll(this,S,new Map);ll(this,_,null);ll(this,U,null);if(this.name=null,this.creator=null,I!==null){this.name=I.name,this.creator=I.creator,ul(this,U,I.order);for(const C of I.groups)bt(this,S).set(C.id,new v(C.name,C.intent));if(I.baseState==="OFF")for(const C of bt(this,S).values())C._setVisible(B,!1);for(const C of I.on)bt(this,S).get(C)._setVisible(B,!0);for(const C of I.off)bt(this,S).get(C)._setVisible(B,!1);ul(this,_,this.getHash())}}isVisible(I){if(bt(this,S).size===0)return!0;if(!I)return(0,m.warn)("Optional content group not defined."),!0;if(I.type==="OCG")return bt(this,S).has(I.id)?bt(this,S).get(I.id).visible:((0,m.warn)(`Optional content group not found: ${I.id}`),!0);if(I.type==="OCMD"){if(I.expression)return nl(this,f,je).call(this,I.expression);if(!I.policy||I.policy==="AnyOn"){for(const C of I.ids){if(!bt(this,S).has(C))return(0,m.warn)(`Optional content group not found: ${C}`),!0;if(bt(this,S).get(C).visible)return!0}return!1}else if(I.policy==="AllOn"){for(const C of I.ids){if(!bt(this,S).has(C))return(0,m.warn)(`Optional content group not found: ${C}`),!0;if(!bt(this,S).get(C).visible)return!1}return!0}else if(I.policy==="AnyOff"){for(const C of I.ids){if(!bt(this,S).has(C))return(0,m.warn)(`Optional content group not found: ${C}`),!0;if(!bt(this,S).get(C).visible)return!0}return!1}else if(I.policy==="AllOff"){for(const C of I.ids){if(!bt(this,S).has(C))return(0,m.warn)(`Optional content group not found: ${C}`),!0;if(bt(this,S).get(C).visible)return!1}return!0}return(0,m.warn)(`Unknown optional content policy ${I.policy}.`),!0}return(0,m.warn)(`Unknown group type ${I.type}.`),!0}setVisibility(I,C=!0){if(!bt(this,S).has(I)){(0,m.warn)(`Optional content group not found: ${I}`);return}bt(this,S).get(I)._setVisible(B,!!C),ul(this,p,null)}get hasInitialVisibility(){return bt(this,_)===null||this.getHash()===bt(this,_)}getOrder(){return bt(this,S).size?bt(this,U)?bt(this,U).slice():[...bt(this,S).keys()]:null}getGroups(){return bt(this,S).size>0?(0,m.objectFromMap)(bt(this,S)):null}getGroup(I){return bt(this,S).get(I)||null}getHash(){if(bt(this,p)!==null)return bt(this,p);const I=new T.MurmurHash3_64;for(const[C,j]of bt(this,S))I.update(`${C}:${j.visible}`);return ul(this,p,I.hexdigest())}}p=new WeakMap,S=new WeakMap,_=new WeakMap,U=new WeakMap,f=new WeakSet,je=function(I){const C=I.length;if(C<2)return!0;const j=I[0];for(let K=1;K{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFDataTransportStream=void 0;var m=h(1),T=h(6);class B{constructor({length:p,initialData:S,progressiveDone:_=!1,contentDispositionFilename:U=null,disableRange:f=!1,disableStream:L=!1},g){if((0,m.assert)(g,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=_,this._contentDispositionFilename=U,(S==null?void 0:S.length)>0){const I=S instanceof Uint8Array&&S.byteLength===S.buffer.byteLength?S.buffer:new Uint8Array(S).buffer;this._queuedChunks.push(I)}this._pdfDataRangeTransport=g,this._isStreamingSupported=!L,this._isRangeSupported=!f,this._contentLength=p,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((I,C)=>{this._onReceiveData({begin:I,chunk:C})}),this._pdfDataRangeTransport.addProgressListener((I,C)=>{this._onProgress({loaded:I,total:C})}),this._pdfDataRangeTransport.addProgressiveReadListener(I=>{this._onReceiveData({chunk:I})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:p,chunk:S}){const _=S instanceof Uint8Array&&S.byteLength===S.buffer.byteLength?S.buffer:new Uint8Array(S).buffer;if(p===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(_):this._queuedChunks.push(_);else{const U=this._rangeReaders.some(function(f){return f._begin!==p?!1:(f._enqueue(_),!0)});(0,m.assert)(U,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var p;return((p=this._fullRequestReader)==null?void 0:p._loaded)??0}_onProgress(p){var S,_,U,f;p.total===void 0?(_=(S=this._rangeReaders[0])==null?void 0:S.onProgress)==null||_.call(S,{loaded:p.loaded}):(f=(U=this._fullRequestReader)==null?void 0:U.onProgress)==null||f.call(U,{loaded:p.loaded,total:p.total})}_onProgressiveDone(){var p;(p=this._fullRequestReader)==null||p.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(p){const S=this._rangeReaders.indexOf(p);S>=0&&this._rangeReaders.splice(S,1)}getFullReader(){(0,m.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const p=this._queuedChunks;return this._queuedChunks=null,new v(this,p,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(p,S){if(S<=this._progressiveDataLength)return null;const _=new F(this,p,S);return this._pdfDataRangeTransport.requestDataRange(p,S),this._rangeReaders.push(_),_}cancelAllRequests(p){var S;(S=this._fullRequestReader)==null||S.cancel(p);for(const _ of this._rangeReaders.slice(0))_.cancel(p);this._pdfDataRangeTransport.abort()}}r.PDFDataTransportStream=B;class v{constructor(p,S,_=!1,U=null){this._stream=p,this._done=_||!1,this._filename=(0,T.isPdfFile)(U)?U:null,this._queuedChunks=S||[],this._loaded=0;for(const f of this._queuedChunks)this._loaded+=f.byteLength;this._requests=[],this._headersReady=Promise.resolve(),p._fullRequestReader=this,this.onProgress=null}_enqueue(p){this._done||(this._requests.length>0?this._requests.shift().resolve({value:p,done:!1}):this._queuedChunks.push(p),this._loaded+=p.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const p=new m.PromiseCapability;return this._requests.push(p),p.promise}cancel(p){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class F{constructor(p,S,_){this._stream=p,this._begin=S,this._end=_,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(p){if(!this._done){if(this._requests.length===0)this._queuedChunk=p;else{this._requests.shift().resolve({value:p,done:!1});for(const _ of this._requests)_.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const S=this._queuedChunk;return this._queuedChunk=null,{value:S,done:!1}}if(this._done)return{value:void 0,done:!0};const p=new m.PromiseCapability;return this._requests.push(p),p.promise}cancel(p){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFFetchStream=void 0;var m=h(1),T=h(20);function B(_,U,f){return{method:"GET",headers:_,signal:f.signal,mode:"cors",credentials:U?"include":"same-origin",redirect:"follow"}}function v(_){const U=new Headers;for(const f in _){const L=_[f];L!==void 0&&U.append(f,L)}return U}function F(_){return _ instanceof Uint8Array?_.buffer:_ instanceof ArrayBuffer?_:((0,m.warn)(`getArrayBuffer - unexpected data format: ${_}`),new Uint8Array(_).buffer)}class J{constructor(U){this.source=U,this.isHttp=/^https?:/i.test(U.url),this.httpHeaders=this.isHttp&&U.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var U;return((U=this._fullRequestReader)==null?void 0:U._loaded)??0}getFullReader(){return(0,m.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new p(this),this._fullRequestReader}getRangeReader(U,f){if(f<=this._progressiveDataLength)return null;const L=new S(this,U,f);return this._rangeRequestReaders.push(L),L}cancelAllRequests(U){var f;(f=this._fullRequestReader)==null||f.cancel(U);for(const L of this._rangeRequestReaders.slice(0))L.cancel(U)}}r.PDFFetchStream=J;class p{constructor(U){this._stream=U,this._reader=null,this._loaded=0,this._filename=null;const f=U.source;this._withCredentials=f.withCredentials||!1,this._contentLength=f.length,this._headersCapability=new m.PromiseCapability,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._headers=v(this._stream.httpHeaders);const L=f.url;fetch(L,B(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,T.validateResponseStatus)(g.status))throw(0,T.createResponseStatusError)(g.status,L);this._reader=g.body.getReader(),this._headersCapability.resolve();const I=K=>g.headers.get(K),{allowRangeRequests:C,suggestedLength:j}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:I,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=C,this._contentLength=j||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(I),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new m.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var L;await this._headersCapability.promise;const{value:U,done:f}=await this._reader.read();return f?{value:U,done:f}:(this._loaded+=U.byteLength,(L=this.onProgress)==null||L.call(this,{loaded:this._loaded,total:this._contentLength}),{value:F(U),done:!1})}cancel(U){var f;(f=this._reader)==null||f.cancel(U),this._abortController.abort()}}class S{constructor(U,f,L){this._stream=U,this._reader=null,this._loaded=0;const g=U.source;this._withCredentials=g.withCredentials||!1,this._readCapability=new m.PromiseCapability,this._isStreamingSupported=!g.disableStream,this._abortController=new AbortController,this._headers=v(this._stream.httpHeaders),this._headers.append("Range",`bytes=${f}-${L-1}`);const I=g.url;fetch(I,B(this._headers,this._withCredentials,this._abortController)).then(C=>{if(!(0,T.validateResponseStatus)(C.status))throw(0,T.createResponseStatusError)(C.status,I);this._readCapability.resolve(),this._reader=C.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var L;await this._readCapability.promise;const{value:U,done:f}=await this._reader.read();return f?{value:U,done:f}:(this._loaded+=U.byteLength,(L=this.onProgress)==null||L.call(this,{loaded:this._loaded}),{value:F(U),done:!1})}cancel(U){var f;(f=this._reader)==null||f.cancel(U),this._abortController.abort()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createResponseStatusError=J,r.extractFilenameFromHeader=F,r.validateRangeRequestCapabilities=v,r.validateResponseStatus=p;var m=h(1),T=h(21),B=h(6);function v({getResponseHeader:S,isHttp:_,rangeChunkSize:U,disableRange:f}){const L={allowRangeRequests:!1,suggestedLength:void 0},g=parseInt(S("Content-Length"),10);return!Number.isInteger(g)||(L.suggestedLength=g,g<=2*U)||f||!_||S("Accept-Ranges")!=="bytes"||(S("Content-Encoding")||"identity")!=="identity"||(L.allowRangeRequests=!0),L}function F(S){const _=S("Content-Disposition");if(_){let U=(0,T.getFilenameFromContentDispositionHeader)(_);if(U.includes("%"))try{U=decodeURIComponent(U)}catch{}if((0,B.isPdfFile)(U))return U}return null}function J(S,_){return S===404||S===0&&_.startsWith("file:")?new m.MissingPDFException('Missing PDF "'+_+'".'):new m.UnexpectedResponseException(`Unexpected server response (${S}) while retrieving PDF "${_}".`,S)}function p(S){return S===200||S===206}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getFilenameFromContentDispositionHeader=T;var m=h(1);function T(B){let v=!0,F=J("filename\\*","i").exec(B);if(F){F=F[1];let g=U(F);return g=unescape(g),g=f(g),g=L(g),S(g)}if(F=_(B),F){const g=L(F);return S(g)}if(F=J("filename","i").exec(B),F){F=F[1];let g=U(F);return g=L(g),S(g)}function J(g,I){return new RegExp("(?:^|;)\\s*"+g+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',I)}function p(g,I){if(g){if(!/^[\x00-\xFF]+$/.test(I))return I;try{const C=new TextDecoder(g,{fatal:!0}),j=(0,m.stringToBytes)(I);I=C.decode(j),v=!1}catch{}}return I}function S(g){return v&&/[\x80-\xff]/.test(g)&&(g=p("utf-8",g),v&&(g=p("iso-8859-1",g))),g}function _(g){const I=[];let C;const j=J("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(C=j.exec(g))!==null;){let[,P,M,u]=C;if(P=parseInt(P,10),P in I){if(P===0)break;continue}I[P]=[M,u]}const K=[];for(let P=0;P{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNetworkStream=void 0;var m=h(1),T=h(20);const B=200,v=206;function F(U){const f=U.response;return typeof f!="string"?f:(0,m.stringToBytes)(f).buffer}class J{constructor(f,L={}){this.url=f,this.isHttp=/^https?:/i.test(f),this.httpHeaders=this.isHttp&&L.httpHeaders||Object.create(null),this.withCredentials=L.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(f,L,g){const I={begin:f,end:L};for(const C in g)I[C]=g[C];return this.request(I)}requestFull(f){return this.request(f)}request(f){const L=new XMLHttpRequest,g=this.currXhrId++,I=this.pendingRequests[g]={xhr:L};L.open("GET",this.url),L.withCredentials=this.withCredentials;for(const C in this.httpHeaders){const j=this.httpHeaders[C];j!==void 0&&L.setRequestHeader(C,j)}return this.isHttp&&"begin"in f&&"end"in f?(L.setRequestHeader("Range",`bytes=${f.begin}-${f.end-1}`),I.expectedStatus=v):I.expectedStatus=B,L.responseType="arraybuffer",f.onError&&(L.onerror=function(C){f.onError(L.status)}),L.onreadystatechange=this.onStateChange.bind(this,g),L.onprogress=this.onProgress.bind(this,g),I.onHeadersReceived=f.onHeadersReceived,I.onDone=f.onDone,I.onError=f.onError,I.onProgress=f.onProgress,L.send(null),g}onProgress(f,L){var I;const g=this.pendingRequests[f];g&&((I=g.onProgress)==null||I.call(g,L))}onStateChange(f,L){var P,M,u;const g=this.pendingRequests[f];if(!g)return;const I=g.xhr;if(I.readyState>=2&&g.onHeadersReceived&&(g.onHeadersReceived(),delete g.onHeadersReceived),I.readyState!==4||!(f in this.pendingRequests))return;if(delete this.pendingRequests[f],I.status===0&&this.isHttp){(P=g.onError)==null||P.call(g,I.status);return}const C=I.status||B;if(!(C===B&&g.expectedStatus===v)&&C!==g.expectedStatus){(M=g.onError)==null||M.call(g,I.status);return}const K=F(I);if(C===v){const q=I.getResponseHeader("Content-Range"),$=/bytes (\d+)-(\d+)\/(\d+)/.exec(q);g.onDone({begin:parseInt($[1],10),chunk:K})}else K?g.onDone({begin:0,chunk:K}):(u=g.onError)==null||u.call(g,I.status)}getRequestXhr(f){return this.pendingRequests[f].xhr}isPendingRequest(f){return f in this.pendingRequests}abortRequest(f){const L=this.pendingRequests[f].xhr;delete this.pendingRequests[f],L.abort()}}class p{constructor(f){this._source=f,this._manager=new J(f.url,{httpHeaders:f.httpHeaders,withCredentials:f.withCredentials}),this._rangeChunkSize=f.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(f){const L=this._rangeRequestReaders.indexOf(f);L>=0&&this._rangeRequestReaders.splice(L,1)}getFullReader(){return(0,m.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new S(this._manager,this._source),this._fullRequestReader}getRangeReader(f,L){const g=new _(this._manager,f,L);return g.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(g),g}cancelAllRequests(f){var L;(L=this._fullRequestReader)==null||L.cancel(f);for(const g of this._rangeRequestReaders.slice(0))g.cancel(f)}}r.PDFNetworkStream=p;class S{constructor(f,L){this._manager=f;const g={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=L.url,this._fullRequestId=f.requestFull(g),this._headersReceivedCapability=new m.PromiseCapability,this._disableRange=L.disableRange||!1,this._contentLength=L.length,this._rangeChunkSize=L.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const f=this._fullRequestId,L=this._manager.getRequestXhr(f),g=j=>L.getResponseHeader(j),{allowRangeRequests:I,suggestedLength:C}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:g,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});I&&(this._isRangeSupported=!0),this._contentLength=C||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(g),this._isRangeSupported&&this._manager.abortRequest(f),this._headersReceivedCapability.resolve()}_onDone(f){if(f&&(this._requests.length>0?this._requests.shift().resolve({value:f.chunk,done:!1}):this._cachedChunks.push(f.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const L of this._requests)L.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(f){this._storedError=(0,T.createResponseStatusError)(f,this._url),this._headersReceivedCapability.reject(this._storedError);for(const L of this._requests)L.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(f){var L;(L=this.onProgress)==null||L.call(this,{loaded:f.loaded,total:f.lengthComputable?f.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const f=new m.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._headersReceivedCapability.reject(f);for(const L of this._requests)L.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class _{constructor(f,L,g){this._manager=f;const I={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=f.url,this._requestId=f.requestRange(L,g,I),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var f;(f=this.onClosed)==null||f.call(this,this)}_onDone(f){const L=f.chunk;this._requests.length>0?this._requests.shift().resolve({value:L,done:!1}):this._queuedChunk=L,this._done=!0;for(const g of this._requests)g.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(f){this._storedError=(0,T.createResponseStatusError)(f,this._url);for(const L of this._requests)L.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(f){var L;this.isStreamingSupported||(L=this.onProgress)==null||L.call(this,{loaded:f.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const L=this._queuedChunk;return this._queuedChunk=null,{value:L,done:!1}}if(this._done)return{value:void 0,done:!0};const f=new m.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0;for(const L of this._requests)L.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNodeStream=void 0;var m=h(1),T=h(20);const B=/^file:\/\/\/[a-zA-Z]:\//;function v(g){const I=require$$5,C=I.parse(g);return C.protocol==="file:"||C.host?C:/^[a-z]:[/\\]/i.test(g)?I.parse(`file:///${g}`):(C.host||(C.protocol="file:"),C)}class F{constructor(I){this.source=I,this.url=v(I.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&I.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var I;return((I=this._fullRequestReader)==null?void 0:I._loaded)??0}getFullReader(){return(0,m.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new _(this),this._fullRequestReader}getRangeReader(I,C){if(C<=this._progressiveDataLength)return null;const j=this.isFsUrl?new L(this,I,C):new U(this,I,C);return this._rangeRequestReaders.push(j),j}cancelAllRequests(I){var C;(C=this._fullRequestReader)==null||C.cancel(I);for(const j of this._rangeRequestReaders.slice(0))j.cancel(I)}}r.PDFNodeStream=F;class J{constructor(I){this._url=I.url,this._done=!1,this._storedError=null,this.onProgress=null;const C=I.source;this._contentLength=C.length,this._loaded=0,this._filename=null,this._disableRange=C.disableRange||!1,this._rangeChunkSize=C.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!C.disableStream,this._isRangeSupported=!C.disableRange,this._readableStream=null,this._readCapability=new m.PromiseCapability,this._headersCapability=new m.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var j;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const I=this._readableStream.read();return I===null?(this._readCapability=new m.PromiseCapability,this.read()):(this._loaded+=I.length,(j=this.onProgress)==null||j.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(I).buffer,done:!1})}cancel(I){if(!this._readableStream){this._error(I);return}this._readableStream.destroy(I)}_error(I){this._storedError=I,this._readCapability.resolve()}_setReadableStream(I){this._readableStream=I,I.on("readable",()=>{this._readCapability.resolve()}),I.on("end",()=>{I.destroy(),this._done=!0,this._readCapability.resolve()}),I.on("error",C=>{this._error(C)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new m.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class p{constructor(I){this._url=I.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new m.PromiseCapability;const C=I.source;this._isStreamingSupported=!C.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var j;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const I=this._readableStream.read();return I===null?(this._readCapability=new m.PromiseCapability,this.read()):(this._loaded+=I.length,(j=this.onProgress)==null||j.call(this,{loaded:this._loaded}),{value:new Uint8Array(I).buffer,done:!1})}cancel(I){if(!this._readableStream){this._error(I);return}this._readableStream.destroy(I)}_error(I){this._storedError=I,this._readCapability.resolve()}_setReadableStream(I){this._readableStream=I,I.on("readable",()=>{this._readCapability.resolve()}),I.on("end",()=>{I.destroy(),this._done=!0,this._readCapability.resolve()}),I.on("error",C=>{this._error(C)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function S(g,I){return{protocol:g.protocol,auth:g.auth,host:g.hostname,port:g.port,path:g.path,method:"GET",headers:I}}class _ extends J{constructor(I){super(I);const C=j=>{if(j.statusCode===404){const u=new m.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u,this._headersCapability.reject(u);return}this._headersCapability.resolve(),this._setReadableStream(j);const K=u=>this._readableStream.headers[u.toLowerCase()],{allowRangeRequests:P,suggestedLength:M}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:K,isHttp:I.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=P,this._contentLength=M||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(K)};if(this._request=null,this._url.protocol==="http:"){const j=require$$5;this._request=j.request(S(this._url,I.httpHeaders),C)}else{const j=require$$5;this._request=j.request(S(this._url,I.httpHeaders),C)}this._request.on("error",j=>{this._storedError=j,this._headersCapability.reject(j)}),this._request.end()}}class U extends p{constructor(I,C,j){super(I),this._httpHeaders={};for(const P in I.httpHeaders){const M=I.httpHeaders[P];M!==void 0&&(this._httpHeaders[P]=M)}this._httpHeaders.Range=`bytes=${C}-${j-1}`;const K=P=>{if(P.statusCode===404){const M=new m.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=M;return}this._setReadableStream(P)};if(this._request=null,this._url.protocol==="http:"){const P=require$$5;this._request=P.request(S(this._url,this._httpHeaders),K)}else{const P=require$$5;this._request=P.request(S(this._url,this._httpHeaders),K)}this._request.on("error",P=>{this._storedError=P}),this._request.end()}}class f extends J{constructor(I){super(I);let C=decodeURIComponent(this._url.path);B.test(this._url.href)&&(C=C.replace(/^\//,""));const j=require$$5;j.lstat(C,(K,P)=>{if(K){K.code==="ENOENT"&&(K=new m.MissingPDFException(`Missing PDF "${C}".`)),this._storedError=K,this._headersCapability.reject(K);return}this._contentLength=P.size,this._setReadableStream(j.createReadStream(C)),this._headersCapability.resolve()})}}class L extends p{constructor(I,C,j){super(I);let K=decodeURIComponent(this._url.path);B.test(this._url.href)&&(K=K.replace(/^\//,""));const P=require$$5;this._setReadableStream(P.createReadStream(K,{start:C,end:j-1}))}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SVGGraphics=void 0;var m=h(6),T=h(1);const B={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},v="http://www.w3.org/XML/1998/namespace",F="http://www.w3.org/1999/xlink",J=["butt","round","square"],p=["miter","round","bevel"],S=function(P,M="",u=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!u)return URL.createObjectURL(new Blob([P],{type:M}));const q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let $=`data:${M};base64,`;for(let H=0,Zt=P.length;H>2,Xt=(at&3)<<4|It>>4,zt=H+1>6:64,Gt=H+2>1&2147483647:it>>1&2147483647;u[xt]=it}function q(xt,it,Xt){let zt=-1;for(let Gt=it;Gt>>8^Ut}return zt^-1}function $(xt,it,Xt,zt){let Gt=zt;const Nt=it.length;Xt[Gt]=Nt>>24&255,Xt[Gt+1]=Nt>>16&255,Xt[Gt+2]=Nt>>8&255,Xt[Gt+3]=Nt&255,Gt+=4,Xt[Gt]=xt.charCodeAt(0)&255,Xt[Gt+1]=xt.charCodeAt(1)&255,Xt[Gt+2]=xt.charCodeAt(2)&255,Xt[Gt+3]=xt.charCodeAt(3)&255,Gt+=4,Xt.set(it,Gt),Gt+=it.length;const Ut=q(Xt,zt+4,Gt);Xt[Gt]=Ut>>24&255,Xt[Gt+1]=Ut>>16&255,Xt[Gt+2]=Ut>>8&255,Xt[Gt+3]=Ut&255}function H(xt,it,Xt){let zt=1,Gt=0;for(let Nt=it;Nt=8?xt:Buffer.from(xt),Xt=require$$5.deflateSync(it,{level:9});return Xt instanceof Uint8Array?Xt:new Uint8Array(Xt)}catch(it){(0,T.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+it)}return at(xt)}function at(xt){let it=xt.length;const Xt=65535,zt=Math.ceil(it/Xt),Gt=new Uint8Array(2+it+zt*5+4);let Nt=0;Gt[Nt++]=120,Gt[Nt++]=156;let Ut=0;for(;it>Xt;)Gt[Nt++]=0,Gt[Nt++]=255,Gt[Nt++]=255,Gt[Nt++]=0,Gt[Nt++]=0,Gt.set(xt.subarray(Ut,Ut+Xt),Nt),Nt+=Xt,Ut+=Xt,it-=Xt;Gt[Nt++]=1,Gt[Nt++]=it&255,Gt[Nt++]=it>>8&255,Gt[Nt++]=~it&65535&255,Gt[Nt++]=(~it&65535)>>8&255,Gt.set(xt.subarray(Ut),Nt),Nt+=xt.length-Ut;const Lt=H(xt,0,xt.length);return Gt[Nt++]=Lt>>24&255,Gt[Nt++]=Lt>>16&255,Gt[Nt++]=Lt>>8&255,Gt[Nt++]=Lt&255,Gt}function It(xt,it,Xt,zt){const Gt=xt.width,Nt=xt.height;let Ut,Lt,Ht;const Pt=xt.data;switch(it){case T.ImageKind.GRAYSCALE_1BPP:Lt=0,Ut=1,Ht=Gt+7>>3;break;case T.ImageKind.RGB_24BPP:Lt=2,Ut=8,Ht=Gt*3;break;case T.ImageKind.RGBA_32BPP:Lt=6,Ut=8,Ht=Gt*4;break;default:throw new Error("invalid format")}const dt=new Uint8Array((1+Ht)*Nt);let w=0,k=0;for(let Mt=0;Mt>24&255,Gt>>16&255,Gt>>8&255,Gt&255,Nt>>24&255,Nt>>16&255,Nt>>8&255,Nt&255,Ut,Lt,0,0,0]),O=Zt(dt),Q=P.length+M*3+X.length+O.length,st=new Uint8Array(Q);let et=0;return st.set(P,et),et+=P.length,$("IHDR",X,st,et),et+=M+X.length,$("IDATA",O,st,et),et+=M+O.length,$("IEND",new Uint8Array(0),st,et),S(st,"image/png",Xt)}return function(it,Xt,zt){const Gt=it.kind===void 0?T.ImageKind.GRAYSCALE_1BPP:it.kind;return It(it,Gt,Xt,zt)}}();class U{constructor(){this.fontSizeScale=1,this.fontWeight=B.fontWeight,this.fontSize=0,this.textMatrix=T.IDENTITY_MATRIX,this.fontMatrix=T.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=T.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=B.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(M,u){this.x=M,this.y=u}}function f(P){let M=[];const u=[];for(const q of P){if(q.fn==="save"){M.push({fnId:92,fn:"group",items:[]}),u.push(M),M=M.at(-1).items;continue}q.fn==="restore"?M=u.pop():M.push(q)}return M}function L(P){if(Number.isInteger(P))return P.toString();const M=P.toFixed(10);let u=M.length-1;if(M[u]!=="0")return M;do u--;while(M[u]==="0");return M.substring(0,M[u]==="."?u:u+1)}function g(P){if(P[4]===0&&P[5]===0){if(P[1]===0&&P[2]===0)return P[0]===1&&P[3]===1?"":`scale(${L(P[0])} ${L(P[3])})`;if(P[0]===P[3]&&P[1]===-P[2]){const M=Math.acos(P[0])*180/Math.PI;return`rotate(${L(M)})`}}else if(P[0]===1&&P[1]===0&&P[2]===0&&P[3]===1)return`translate(${L(P[4])} ${L(P[5])})`;return`matrix(${L(P[0])} ${L(P[1])} ${L(P[2])} ${L(P[3])} ${L(P[4])} ${L(P[5])})`}let I=0,C=0,j=0;class K{constructor(M,u,q=!1){(0,m.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new m.DOMSVGFactory,this.current=new U,this.transformMatrix=T.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=M,this.objs=u,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!q,this._operatorIdMapping=[];for(const $ in T.OPS)this._operatorIdMapping[T.OPS[$]]=$}getObject(M,u=null){return typeof M=="string"?M.startsWith("g_")?this.commonObjs.get(M):this.objs.get(M):u}save(){this.transformStack.push(this.transformMatrix);const M=this.current;this.extraStack.push(M),this.current=M.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(M){this.save(),this.executeOpTree(M),this.restore()}loadDependencies(M){const u=M.fnArray,q=M.argsArray;for(let $=0,H=u.length;${at.get(Zt,xt)});this.current.dependencies.push(It)}return Promise.all(this.current.dependencies)}transform(M,u,q,$,H,Zt){const at=[M,u,q,$,H,Zt];this.transformMatrix=T.Util.transform(this.transformMatrix,at),this.tgrp=null}getSVG(M,u){this.viewport=u;const q=this._initialize(u);return this.loadDependencies(M).then(()=>(this.transformMatrix=T.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(M)),q))}convertOpList(M){const u=this._operatorIdMapping,q=M.argsArray,$=M.fnArray,H=[];for(let Zt=0,at=$.length;Zt0&&(this.current.lineWidth=M)}setLineCap(M){this.current.lineCap=J[M]}setLineJoin(M){this.current.lineJoin=p[M]}setMiterLimit(M){this.current.miterLimit=M}setStrokeAlpha(M){this.current.strokeAlpha=M}setStrokeRGBColor(M,u,q){this.current.strokeColor=T.Util.makeHexColor(M,u,q)}setFillAlpha(M){this.current.fillAlpha=M}setFillRGBColor(M,u,q){this.current.fillColor=T.Util.makeHexColor(M,u,q),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(M){this.current.strokeColor=this._makeColorN_Pattern(M)}setFillColorN(M){this.current.fillColor=this._makeColorN_Pattern(M)}shadingFill(M){const{width:u,height:q}=this.viewport,$=T.Util.inverseTransform(this.transformMatrix),[H,Zt,at,It]=T.Util.getAxialAlignedBoundingBox([0,0,u,q],$),xt=this.svgFactory.createElement("svg:rect");xt.setAttributeNS(null,"x",H),xt.setAttributeNS(null,"y",Zt),xt.setAttributeNS(null,"width",at-H),xt.setAttributeNS(null,"height",It-Zt),xt.setAttributeNS(null,"fill",this._makeShadingPattern(M)),this.current.fillAlpha<1&&xt.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(xt)}_makeColorN_Pattern(M){return M[0]==="TilingPattern"?this._makeTilingPattern(M):this._makeShadingPattern(M)}_makeTilingPattern(M){const u=M[1],q=M[2],$=M[3]||T.IDENTITY_MATRIX,[H,Zt,at,It]=M[4],xt=M[5],it=M[6],Xt=M[7],zt=`shading${j++}`,[Gt,Nt,Ut,Lt]=T.Util.normalizeRect([...T.Util.applyTransform([H,Zt],$),...T.Util.applyTransform([at,It],$)]),[Ht,Pt]=T.Util.singularValueDecompose2dScale($),dt=xt*Ht,w=it*Pt,k=this.svgFactory.createElement("svg:pattern");k.setAttributeNS(null,"id",zt),k.setAttributeNS(null,"patternUnits","userSpaceOnUse"),k.setAttributeNS(null,"width",dt),k.setAttributeNS(null,"height",w),k.setAttributeNS(null,"x",`${Gt}`),k.setAttributeNS(null,"y",`${Nt}`);const X=this.svg,O=this.transformMatrix,Q=this.current.fillColor,st=this.current.strokeColor,et=this.svgFactory.create(Ut-Gt,Lt-Nt);if(this.svg=et,this.transformMatrix=$,Xt===2){const Mt=T.Util.makeHexColor(...u);this.current.fillColor=Mt,this.current.strokeColor=Mt}return this.executeOpTree(this.convertOpList(q)),this.svg=X,this.transformMatrix=O,this.current.fillColor=Q,this.current.strokeColor=st,k.append(et.childNodes[0]),this.defs.append(k),`url(#${zt})`}_makeShadingPattern(M){switch(typeof M=="string"&&(M=this.objs.get(M)),M[0]){case"RadialAxial":const u=`shading${j++}`,q=M[3];let $;switch(M[1]){case"axial":const H=M[4],Zt=M[5];$=this.svgFactory.createElement("svg:linearGradient"),$.setAttributeNS(null,"id",u),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"x1",H[0]),$.setAttributeNS(null,"y1",H[1]),$.setAttributeNS(null,"x2",Zt[0]),$.setAttributeNS(null,"y2",Zt[1]);break;case"radial":const at=M[4],It=M[5],xt=M[6],it=M[7];$=this.svgFactory.createElement("svg:radialGradient"),$.setAttributeNS(null,"id",u),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"cx",It[0]),$.setAttributeNS(null,"cy",It[1]),$.setAttributeNS(null,"r",it),$.setAttributeNS(null,"fx",at[0]),$.setAttributeNS(null,"fy",at[1]),$.setAttributeNS(null,"fr",xt);break;default:throw new Error(`Unknown RadialAxial type: ${M[1]}`)}for(const H of q){const Zt=this.svgFactory.createElement("svg:stop");Zt.setAttributeNS(null,"offset",H[0]),Zt.setAttributeNS(null,"stop-color",H[1]),$.append(Zt)}return this.defs.append($),`url(#${u})`;case"Mesh":return(0,T.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${M[0]}`)}}setDash(M,u){this.current.dashArray=M,this.current.dashPhase=u}constructPath(M,u){const q=this.current;let $=q.x,H=q.y,Zt=[],at=0;for(const It of M)switch(It|0){case T.OPS.rectangle:$=u[at++],H=u[at++];const xt=u[at++],it=u[at++],Xt=$+xt,zt=H+it;Zt.push("M",L($),L(H),"L",L(Xt),L(H),"L",L(Xt),L(zt),"L",L($),L(zt),"Z");break;case T.OPS.moveTo:$=u[at++],H=u[at++],Zt.push("M",L($),L(H));break;case T.OPS.lineTo:$=u[at++],H=u[at++],Zt.push("L",L($),L(H));break;case T.OPS.curveTo:$=u[at+4],H=u[at+5],Zt.push("C",L(u[at]),L(u[at+1]),L(u[at+2]),L(u[at+3]),L($),L(H)),at+=6;break;case T.OPS.curveTo2:Zt.push("C",L($),L(H),L(u[at]),L(u[at+1]),L(u[at+2]),L(u[at+3])),$=u[at+2],H=u[at+3],at+=4;break;case T.OPS.curveTo3:$=u[at+2],H=u[at+3],Zt.push("C",L(u[at]),L(u[at+1]),L($),L(H),L($),L(H)),at+=4;break;case T.OPS.closePath:Zt.push("Z");break}Zt=Zt.join(" "),q.path&&M.length>0&&M[0]!==T.OPS.rectangle&&M[0]!==T.OPS.moveTo?Zt=q.path.getAttributeNS(null,"d")+Zt:(q.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(q.path)),q.path.setAttributeNS(null,"d",Zt),q.path.setAttributeNS(null,"fill","none"),q.element=q.path,q.setCurrentPoint($,H)}endPath(){const M=this.current;if(M.path=null,!this.pendingClip)return;if(!M.element){this.pendingClip=null;return}const u=`clippath${I++}`,q=this.svgFactory.createElement("svg:clipPath");q.setAttributeNS(null,"id",u),q.setAttributeNS(null,"transform",g(this.transformMatrix));const $=M.element.cloneNode(!0);if(this.pendingClip==="evenodd"?$.setAttributeNS(null,"clip-rule","evenodd"):$.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,q.append($),this.defs.append(q),M.activeClipUrl){M.clipGroup=null;for(const H of this.extraStack)H.clipGroup=null;q.setAttributeNS(null,"clip-path",M.activeClipUrl)}M.activeClipUrl=`url(#${u})`,this.tgrp=null}clip(M){this.pendingClip=M}closePath(){const M=this.current;if(M.path){const u=`${M.path.getAttributeNS(null,"d")}Z`;M.path.setAttributeNS(null,"d",u)}}setLeading(M){this.current.leading=-M}setTextRise(M){this.current.textRise=M}setTextRenderingMode(M){this.current.textRenderingMode=M}setHScale(M){this.current.textHScale=M/100}setRenderingIntent(M){}setFlatness(M){}setGState(M){for(const[u,q]of M)switch(u){case"LW":this.setLineWidth(q);break;case"LC":this.setLineCap(q);break;case"LJ":this.setLineJoin(q);break;case"ML":this.setMiterLimit(q);break;case"D":this.setDash(q[0],q[1]);break;case"RI":this.setRenderingIntent(q);break;case"FL":this.setFlatness(q);break;case"Font":this.setFont(q);break;case"CA":this.setStrokeAlpha(q);break;case"ca":this.setFillAlpha(q);break;default:(0,T.warn)(`Unimplemented graphic state operator ${u}`);break}}fill(){const M=this.current;M.element&&(M.element.setAttributeNS(null,"fill",M.fillColor),M.element.setAttributeNS(null,"fill-opacity",M.fillAlpha),this.endPath())}stroke(){const M=this.current;M.element&&(this._setStrokeAttributes(M.element),M.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(M,u=1){const q=this.current;let $=q.dashArray;u!==1&&$.length>0&&($=$.map(function(H){return u*H})),M.setAttributeNS(null,"stroke",q.strokeColor),M.setAttributeNS(null,"stroke-opacity",q.strokeAlpha),M.setAttributeNS(null,"stroke-miterlimit",L(q.miterLimit)),M.setAttributeNS(null,"stroke-linecap",q.lineCap),M.setAttributeNS(null,"stroke-linejoin",q.lineJoin),M.setAttributeNS(null,"stroke-width",L(u*q.lineWidth)+"px"),M.setAttributeNS(null,"stroke-dasharray",$.map(L).join(" ")),M.setAttributeNS(null,"stroke-dashoffset",L(u*q.dashPhase)+"px")}eoFill(){var M;(M=this.current.element)==null||M.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var M;(M=this.current.element)==null||M.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const M=this.svgFactory.createElement("svg:rect");M.setAttributeNS(null,"x","0"),M.setAttributeNS(null,"y","0"),M.setAttributeNS(null,"width","1px"),M.setAttributeNS(null,"height","1px"),M.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(M)}paintImageXObject(M){const u=this.getObject(M);if(!u){(0,T.warn)(`Dependent image with object ID ${M} is not ready yet`);return}this.paintInlineImageXObject(u)}paintInlineImageXObject(M,u){const q=M.width,$=M.height,H=_(M,this.forceDataSchema,!!u),Zt=this.svgFactory.createElement("svg:rect");Zt.setAttributeNS(null,"x","0"),Zt.setAttributeNS(null,"y","0"),Zt.setAttributeNS(null,"width",L(q)),Zt.setAttributeNS(null,"height",L($)),this.current.element=Zt,this.clip("nonzero");const at=this.svgFactory.createElement("svg:image");at.setAttributeNS(F,"xlink:href",H),at.setAttributeNS(null,"x","0"),at.setAttributeNS(null,"y",L(-$)),at.setAttributeNS(null,"width",L(q)+"px"),at.setAttributeNS(null,"height",L($)+"px"),at.setAttributeNS(null,"transform",`scale(${L(1/q)} ${L(-1/$)})`),u?u.append(at):this._ensureTransformGroup().append(at)}paintImageMaskXObject(M){const u=this.getObject(M.data,M);if(u.bitmap){(0,T.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const q=this.current,$=u.width,H=u.height,Zt=q.fillColor;q.maskId=`mask${C++}`;const at=this.svgFactory.createElement("svg:mask");at.setAttributeNS(null,"id",q.maskId);const It=this.svgFactory.createElement("svg:rect");It.setAttributeNS(null,"x","0"),It.setAttributeNS(null,"y","0"),It.setAttributeNS(null,"width",L($)),It.setAttributeNS(null,"height",L(H)),It.setAttributeNS(null,"fill",Zt),It.setAttributeNS(null,"mask",`url(#${q.maskId})`),this.defs.append(at),this._ensureTransformGroup().append(It),this.paintInlineImageXObject(u,at)}paintFormXObjectBegin(M,u){if(Array.isArray(M)&&M.length===6&&this.transform(M[0],M[1],M[2],M[3],M[4],M[5]),u){const q=u[2]-u[0],$=u[3]-u[1],H=this.svgFactory.createElement("svg:rect");H.setAttributeNS(null,"x",u[0]),H.setAttributeNS(null,"y",u[1]),H.setAttributeNS(null,"width",L(q)),H.setAttributeNS(null,"height",L($)),this.current.element=H,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(M){const u=this.svgFactory.create(M.width,M.height),q=this.svgFactory.createElement("svg:defs");u.append(q),this.defs=q;const $=this.svgFactory.createElement("svg:g");return $.setAttributeNS(null,"transform",g(M.transform)),u.append($),this.svg=$,u}_ensureClipGroup(){if(!this.current.clipGroup){const M=this.svgFactory.createElement("svg:g");M.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(M),this.current.clipGroup=M}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",g(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}r.SVGGraphics=K},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.XfaText=void 0;class h{static textContent(T){const B=[],v={items:B,styles:Object.create(null)};function F(J){var _;if(!J)return;let p=null;const S=J.name;if(S==="#text")p=J.value;else if(h.shouldBuildText(S))(_=J==null?void 0:J.attributes)!=null&&_.textContent?p=J.attributes.textContent:J.value&&(p=J.value);else return;if(p!==null&&B.push({str:p}),!!J.children)for(const U of J.children)F(U)}return F(T),v}static shouldBuildText(T){return!(T==="textarea"||T==="input"||T==="option"||T==="select")}}r.XfaText=h},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextLayerRenderTask=void 0,r.renderTextLayer=g,r.updateTextLayer=I;var m=h(1),T=h(6);const B=1e5,v=30,F=.8,J=new Map;function p(C,j){let K;if(j&&m.FeatureTest.isOffscreenCanvasSupported)K=new OffscreenCanvas(C,C).getContext("2d",{alpha:!1});else{const P=document.createElement("canvas");P.width=P.height=C,K=P.getContext("2d",{alpha:!1})}return K}function S(C,j){const K=J.get(C);if(K)return K;const P=p(v,j);P.font=`${v}px ${C}`;const M=P.measureText("");let u=M.fontBoundingBoxAscent,q=Math.abs(M.fontBoundingBoxDescent);if(u){const H=u/(u+q);return J.set(C,H),P.canvas.width=P.canvas.height=0,H}P.strokeStyle="red",P.clearRect(0,0,v,v),P.strokeText("g",0,0);let $=P.getImageData(0,0,v,v).data;q=0;for(let H=$.length-1-3;H>=0;H-=4)if($[H]>0){q=Math.ceil(H/4/v);break}P.clearRect(0,0,v,v),P.strokeText("A",0,v),$=P.getImageData(0,0,v,v).data,u=0;for(let H=0,Zt=$.length;H0){u=v-Math.floor(H/4/v);break}if(P.canvas.width=P.canvas.height=0,u){const H=u/(u+q);return J.set(C,H),H}return J.set(C,F),F}function _(C,j,K){const P=document.createElement("span"),M={angle:0,canvasWidth:0,hasText:j.str!=="",hasEOL:j.hasEOL,fontSize:0};C._textDivs.push(P);const u=m.Util.transform(C._transform,j.transform);let q=Math.atan2(u[1],u[0]);const $=K[j.fontName];$.vertical&&(q+=Math.PI/2);const H=Math.hypot(u[2],u[3]),Zt=H*S($.fontFamily,C._isOffscreenCanvasSupported);let at,It;q===0?(at=u[4],It=u[5]-Zt):(at=u[4]+Zt*Math.sin(q),It=u[5]-Zt*Math.cos(q));const xt="calc(var(--scale-factor)*",it=P.style;C._container===C._rootContainer?(it.left=`${(100*at/C._pageWidth).toFixed(2)}%`,it.top=`${(100*It/C._pageHeight).toFixed(2)}%`):(it.left=`${xt}${at.toFixed(2)}px)`,it.top=`${xt}${It.toFixed(2)}px)`),it.fontSize=`${xt}${H.toFixed(2)}px)`,it.fontFamily=$.fontFamily,M.fontSize=H,P.setAttribute("role","presentation"),P.textContent=j.str,P.dir=j.dir,C._fontInspectorEnabled&&(P.dataset.fontName=j.fontName),q!==0&&(M.angle=q*(180/Math.PI));let Xt=!1;if(j.str.length>1)Xt=!0;else if(j.str!==" "&&j.transform[0]!==j.transform[3]){const zt=Math.abs(j.transform[0]),Gt=Math.abs(j.transform[3]);zt!==Gt&&Math.max(zt,Gt)/Math.min(zt,Gt)>1.5&&(Xt=!0)}Xt&&(M.canvasWidth=$.vertical?j.height:j.width),C._textDivProperties.set(P,M),C._isReadableStream&&C._layoutText(P)}function U(C){const{div:j,scale:K,properties:P,ctx:M,prevFontSize:u,prevFontFamily:q}=C,{style:$}=j;let H="";if(P.canvasWidth!==0&&P.hasText){const{fontFamily:Zt}=$,{canvasWidth:at,fontSize:It}=P;(u!==It||q!==Zt)&&(M.font=`${It*K}px ${Zt}`,C.prevFontSize=It,C.prevFontFamily=Zt);const{width:xt}=M.measureText(j.textContent);xt>0&&(H=`scaleX(${at*K/xt})`)}P.angle!==0&&(H=`rotate(${P.angle}deg) ${H}`),H.length>0&&($.transform=H)}function f(C){if(C._canceled)return;const j=C._textDivs,K=C._capability;if(j.length>B){K.resolve();return}if(!C._isReadableStream)for(const M of j)C._layoutText(M);K.resolve()}class L{constructor({textContentSource:j,container:K,viewport:P,textDivs:M,textDivProperties:u,textContentItemsStr:q,isOffscreenCanvasSupported:$}){var xt;this._textContentSource=j,this._isReadableStream=j instanceof ReadableStream,this._container=this._rootContainer=K,this._textDivs=M||[],this._textContentItemsStr=q||[],this._isOffscreenCanvasSupported=$,this._fontInspectorEnabled=!!((xt=globalThis.FontInspector)!=null&&xt.enabled),this._reader=null,this._textDivProperties=u||new WeakMap,this._canceled=!1,this._capability=new m.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:P.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:p(0,$)};const{pageWidth:H,pageHeight:Zt,pageX:at,pageY:It}=P.rawDims;this._transform=[1,0,0,-1,-at,It+Zt],this._pageWidth=H,this._pageHeight=Zt,(0,T.setLayerDimensions)(K,P),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new m.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new m.AbortException("TextLayer task cancelled."))}_processItems(j,K){for(const P of j){if(P.str===void 0){if(P.type==="beginMarkedContentProps"||P.type==="beginMarkedContent"){const M=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),P.id!==null&&this._container.setAttribute("id",`${P.id}`),M.append(this._container)}else P.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(P.str),_(this,P,K)}}_layoutText(j){const K=this._layoutTextParams.properties=this._textDivProperties.get(j);if(this._layoutTextParams.div=j,U(this._layoutTextParams),K.hasText&&this._container.append(j),K.hasEOL){const P=document.createElement("br");P.setAttribute("role","presentation"),this._container.append(P)}}_render(){const j=new m.PromiseCapability;let K=Object.create(null);if(this._isReadableStream){const P=()=>{this._reader.read().then(({value:M,done:u})=>{if(u){j.resolve();return}Object.assign(K,M.styles),this._processItems(M.items,K),P()},j.reject)};this._reader=this._textContentSource.getReader(),P()}else if(this._textContentSource){const{items:P,styles:M}=this._textContentSource;this._processItems(P,M),j.resolve()}else throw new Error('No "textContentSource" parameter specified.');j.promise.then(()=>{K=null,f(this)},this._capability.reject)}}r.TextLayerRenderTask=L;function g(C){!C.textContentSource&&(C.textContent||C.textContentStream)&&((0,T.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),C.textContentSource=C.textContent||C.textContentStream);const{container:j,viewport:K}=C,P=getComputedStyle(j),M=P.getPropertyValue("visibility"),u=parseFloat(P.getPropertyValue("--scale-factor"));M==="visible"&&(!u||Math.abs(u-K.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const q=new L(C);return q._render(),q}function I({container:C,viewport:j,textDivs:K,textDivProperties:P,isOffscreenCanvasSupported:M,mustRotate:u=!0,mustRescale:q=!0}){if(u&&(0,T.setLayerDimensions)(C,{rotation:j.rotation}),q){const $=p(0,M),Zt={prevFontSize:null,prevFontFamily:null,div:null,scale:j.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:$};for(const at of K)Zt.properties=P.get(at),Zt.div=at,U(Zt)}}},(lt,r,h)=>{var S,_,U,f,L,g,I,C,j,K,P,Fe,u,be,$,Je,Zt,Oe;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditorLayer=void 0;var m=h(1),T=h(4),B=h(28),v=h(33),F=h(6),J=h(34);const It=class It{constructor({uiManager:it,pageIndex:Xt,div:zt,accessibilityManager:Gt,annotationLayer:Nt,viewport:Ut,l10n:Lt}){ll(this,P);ll(this,u);ll(this,$);ll(this,Zt);ll(this,S,void 0);ll(this,_,!1);ll(this,U,null);ll(this,f,this.pointerup.bind(this));ll(this,L,this.pointerdown.bind(this));ll(this,g,new Map);ll(this,I,!1);ll(this,C,!1);ll(this,j,!1);ll(this,K,void 0);const Ht=[B.FreeTextEditor,v.InkEditor,J.StampEditor];if(!It._initialized){It._initialized=!0;for(const Pt of Ht)Pt.initialize(Lt)}it.registerEditorTypes(Ht),ul(this,K,it),this.pageIndex=Xt,this.div=zt,ul(this,S,Gt),ul(this,U,Nt),this.viewport=Ut,bt(this,K).addLayer(this)}get isEmpty(){return bt(this,g).size===0}updateToolbar(it){bt(this,K).updateToolbar(it)}updateMode(it=bt(this,K).getMode()){nl(this,Zt,Oe).call(this),it===m.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),it!==m.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",it===m.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",it===m.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",it===m.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(it){if(!it&&bt(this,K).getMode()!==m.AnnotationEditorType.INK)return;if(!it){for(const zt of bt(this,g).values())if(zt.isEmpty()){zt.setInBackground();return}}nl(this,u,be).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(it){bt(this,K).setEditingState(it)}addCommands(it){bt(this,K).addCommands(it)}enable(){this.div.style.pointerEvents="auto";const it=new Set;for(const zt of bt(this,g).values())zt.enableEditing(),zt.annotationElementId&&it.add(zt.annotationElementId);if(!bt(this,U))return;const Xt=bt(this,U).getEditableAnnotations();for(const zt of Xt){if(zt.hide(),bt(this,K).isDeletedAnnotationElement(zt.data.id)||it.has(zt.data.id))continue;const Gt=this.deserialize(zt);Gt&&(this.addOrRebuild(Gt),Gt.enableEditing())}}disable(){var Xt;ul(this,j,!0),this.div.style.pointerEvents="none";const it=new Set;for(const zt of bt(this,g).values()){if(zt.disableEditing(),!zt.annotationElementId||zt.serialize()!==null){it.add(zt.annotationElementId);continue}(Xt=this.getEditableAnnotation(zt.annotationElementId))==null||Xt.show(),zt.remove()}if(bt(this,U)){const zt=bt(this,U).getEditableAnnotations();for(const Gt of zt){const{id:Nt}=Gt.data;it.has(Nt)||bt(this,K).isDeletedAnnotationElement(Nt)||Gt.show()}}nl(this,Zt,Oe).call(this),this.isEmpty&&(this.div.hidden=!0),ul(this,j,!1)}getEditableAnnotation(it){var Xt;return((Xt=bt(this,U))==null?void 0:Xt.getEditableAnnotation(it))||null}setActiveEditor(it){bt(this,K).getActive()!==it&&bt(this,K).setActiveEditor(it)}enableClick(){this.div.addEventListener("pointerdown",bt(this,L)),this.div.addEventListener("pointerup",bt(this,f))}disableClick(){this.div.removeEventListener("pointerdown",bt(this,L)),this.div.removeEventListener("pointerup",bt(this,f))}attach(it){bt(this,g).set(it.id,it);const{annotationElementId:Xt}=it;Xt&&bt(this,K).isDeletedAnnotationElement(Xt)&&bt(this,K).removeDeletedAnnotationElement(it)}detach(it){var Xt;bt(this,g).delete(it.id),(Xt=bt(this,S))==null||Xt.removePointerInTextLayer(it.contentDiv),!bt(this,j)&&it.annotationElementId&&bt(this,K).addDeletedAnnotationElement(it)}remove(it){this.detach(it),bt(this,K).removeEditor(it),it.div.contains(document.activeElement)&&setTimeout(()=>{bt(this,K).focusMainContainer()},0),it.div.remove(),it.isAttachedToDOM=!1,bt(this,C)||this.addInkEditorIfNeeded(!1)}changeParent(it){var Xt;it.parent!==this&&(it.annotationElementId&&(bt(this,K).addDeletedAnnotationElement(it.annotationElementId),T.AnnotationEditor.deleteAnnotationElement(it),it.annotationElementId=null),this.attach(it),(Xt=it.parent)==null||Xt.detach(it),it.setParent(this),it.div&&it.isAttachedToDOM&&(it.div.remove(),this.div.append(it.div)))}add(it){if(this.changeParent(it),bt(this,K).addEditor(it),this.attach(it),!it.isAttachedToDOM){const Xt=it.render();this.div.append(Xt),it.isAttachedToDOM=!0}it.fixAndSetPosition(),it.onceAdded(),bt(this,K).addToAnnotationStorage(it)}moveEditorInDOM(it){var zt;if(!it.isAttachedToDOM)return;const{activeElement:Xt}=document;it.div.contains(Xt)&&(it._focusEventsAllowed=!1,setTimeout(()=>{it.div.contains(document.activeElement)?it._focusEventsAllowed=!0:(it.div.addEventListener("focusin",()=>{it._focusEventsAllowed=!0},{once:!0}),Xt.focus())},0)),it._structTreeParentId=(zt=bt(this,S))==null?void 0:zt.moveElementInDOM(this.div,it.div,it.contentDiv,!0)}addOrRebuild(it){it.needsToBeRebuilt()?it.rebuild():this.add(it)}addUndoableEditor(it){const Xt=()=>it._uiManager.rebuild(it),zt=()=>{it.remove()};this.addCommands({cmd:Xt,undo:zt,mustExec:!1})}getNextId(){return bt(this,K).getId()}pasteEditor(it,Xt){bt(this,K).updateToolbar(it),bt(this,K).updateMode(it);const{offsetX:zt,offsetY:Gt}=nl(this,$,Je).call(this),Nt=this.getNextId(),Ut=nl(this,P,Fe).call(this,{parent:this,id:Nt,x:zt,y:Gt,uiManager:bt(this,K),isCentered:!0,...Xt});Ut&&this.add(Ut)}deserialize(it){switch(it.annotationType??it.annotationEditorType){case m.AnnotationEditorType.FREETEXT:return B.FreeTextEditor.deserialize(it,this,bt(this,K));case m.AnnotationEditorType.INK:return v.InkEditor.deserialize(it,this,bt(this,K));case m.AnnotationEditorType.STAMP:return J.StampEditor.deserialize(it,this,bt(this,K))}return null}addNewEditor(){nl(this,u,be).call(this,nl(this,$,Je).call(this),!0)}setSelected(it){bt(this,K).setSelected(it)}toggleSelected(it){bt(this,K).toggleSelected(it)}isSelected(it){return bt(this,K).isSelected(it)}unselect(it){bt(this,K).unselect(it)}pointerup(it){const{isMac:Xt}=m.FeatureTest.platform;if(!(it.button!==0||it.ctrlKey&&Xt)&&it.target===this.div&&bt(this,I)){if(ul(this,I,!1),!bt(this,_)){ul(this,_,!0);return}if(bt(this,K).getMode()===m.AnnotationEditorType.STAMP){bt(this,K).unselectAll();return}nl(this,u,be).call(this,it,!1)}}pointerdown(it){if(bt(this,I)){ul(this,I,!1);return}const{isMac:Xt}=m.FeatureTest.platform;if(it.button!==0||it.ctrlKey&&Xt||it.target!==this.div)return;ul(this,I,!0);const zt=bt(this,K).getActive();ul(this,_,!zt||zt.isEmpty())}findNewParent(it,Xt,zt){const Gt=bt(this,K).findParent(Xt,zt);return Gt===null||Gt===this?!1:(Gt.changeParent(it),!0)}destroy(){var it,Xt;((it=bt(this,K).getActive())==null?void 0:it.parent)===this&&(bt(this,K).commitOrRemove(),bt(this,K).setActiveEditor(null));for(const zt of bt(this,g).values())(Xt=bt(this,S))==null||Xt.removePointerInTextLayer(zt.contentDiv),zt.setParent(null),zt.isAttachedToDOM=!1,zt.div.remove();this.div=null,bt(this,g).clear(),bt(this,K).removeLayer(this)}render({viewport:it}){this.viewport=it,(0,F.setLayerDimensions)(this.div,it);for(const Xt of bt(this,K).getEditors(this.pageIndex))this.add(Xt);this.updateMode()}update({viewport:it}){bt(this,K).commitOrRemove(),this.viewport=it,(0,F.setLayerDimensions)(this.div,{rotation:it.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:it,pageHeight:Xt}=this.viewport.rawDims;return[it,Xt]}};S=new WeakMap,_=new WeakMap,U=new WeakMap,f=new WeakMap,L=new WeakMap,g=new WeakMap,I=new WeakMap,C=new WeakMap,j=new WeakMap,K=new WeakMap,P=new WeakSet,Fe=function(it){switch(bt(this,K).getMode()){case m.AnnotationEditorType.FREETEXT:return new B.FreeTextEditor(it);case m.AnnotationEditorType.INK:return new v.InkEditor(it);case m.AnnotationEditorType.STAMP:return new J.StampEditor(it)}return null},u=new WeakSet,be=function(it,Xt){const zt=this.getNextId(),Gt=nl(this,P,Fe).call(this,{parent:this,id:zt,x:it.offsetX,y:it.offsetY,uiManager:bt(this,K),isCentered:Xt});return Gt&&this.add(Gt),Gt},$=new WeakSet,Je=function(){const{x:it,y:Xt,width:zt,height:Gt}=this.div.getBoundingClientRect(),Nt=Math.max(0,it),Ut=Math.max(0,Xt),Lt=Math.min(window.innerWidth,it+zt),Ht=Math.min(window.innerHeight,Xt+Gt),Pt=(Nt+Lt)/2-it,dt=(Ut+Ht)/2-Xt,[w,k]=this.viewport.rotation%180===0?[Pt,dt]:[dt,Pt];return{offsetX:w,offsetY:k}},Zt=new WeakSet,Oe=function(){ul(this,C,!0);for(const it of bt(this,g).values())it.isEmpty()&&it.remove();ul(this,C,!1)},gl(It,"_initialized",!1);let p=It;r.AnnotationEditorLayer=p},(lt,r,h)=>{var J,p,S,_,U,f,L,g,I,C,us,K,Ws,M,Gs,q,le,H,Ue,at,rs,xt,Ee;Object.defineProperty(r,"__esModule",{value:!0}),r.FreeTextEditor=void 0;var m=h(1),T=h(5),B=h(4),v=h(29);const Xt=class Xt extends B.AnnotationEditor{constructor(Nt){super({...Nt,name:"freeTextEditor"});ll(this,C);ll(this,K);ll(this,M);ll(this,q);ll(this,H);ll(this,at);ll(this,xt);ll(this,J,this.editorDivBlur.bind(this));ll(this,p,this.editorDivFocus.bind(this));ll(this,S,this.editorDivInput.bind(this));ll(this,_,this.editorDivKeydown.bind(this));ll(this,U,void 0);ll(this,f,"");ll(this,L,`${this.id}-editor`);ll(this,g,void 0);ll(this,I,null);ul(this,U,Nt.color||Xt._defaultColor||B.AnnotationEditor._defaultLineColor),ul(this,g,Nt.fontSize||Xt._defaultFontSize)}static get _keyboardManager(){const Nt=Xt.prototype,Ut=Pt=>Pt.isEmpty(),Lt=T.AnnotationEditorUIManager.TRANSLATE_SMALL,Ht=T.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,m.shadow)(this,"_keyboardManager",new T.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Nt.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Nt.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Nt._translateEmpty,{args:[-Lt,0],checker:Ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Nt._translateEmpty,{args:[-Ht,0],checker:Ut}],[["ArrowRight","mac+ArrowRight"],Nt._translateEmpty,{args:[Lt,0],checker:Ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Nt._translateEmpty,{args:[Ht,0],checker:Ut}],[["ArrowUp","mac+ArrowUp"],Nt._translateEmpty,{args:[0,-Lt],checker:Ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Nt._translateEmpty,{args:[0,-Ht],checker:Ut}],[["ArrowDown","mac+ArrowDown"],Nt._translateEmpty,{args:[0,Lt],checker:Ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Nt._translateEmpty,{args:[0,Ht],checker:Ut}]]))}static initialize(Nt){B.AnnotationEditor.initialize(Nt,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const Ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(Ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Nt,Ut){switch(Nt){case m.AnnotationEditorParamsType.FREETEXT_SIZE:Xt._defaultFontSize=Ut;break;case m.AnnotationEditorParamsType.FREETEXT_COLOR:Xt._defaultColor=Ut;break}}updateParams(Nt,Ut){switch(Nt){case m.AnnotationEditorParamsType.FREETEXT_SIZE:nl(this,C,us).call(this,Ut);break;case m.AnnotationEditorParamsType.FREETEXT_COLOR:nl(this,K,Ws).call(this,Ut);break}}static get defaultPropertiesToUpdate(){return[[m.AnnotationEditorParamsType.FREETEXT_SIZE,Xt._defaultFontSize],[m.AnnotationEditorParamsType.FREETEXT_COLOR,Xt._defaultColor||B.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[m.AnnotationEditorParamsType.FREETEXT_SIZE,bt(this,g)],[m.AnnotationEditorParamsType.FREETEXT_COLOR,bt(this,U)]]}_translateEmpty(Nt,Ut){this._uiManager.translateSelectedEditors(Nt,Ut,!0)}getInitialTranslation(){const Nt=this.parentScale;return[-Xt._internalPadding*Nt,-(Xt._internalPadding+bt(this,g))*Nt]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(m.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",bt(this,_)),this.editorDiv.addEventListener("focus",bt(this,p)),this.editorDiv.addEventListener("blur",bt(this,J)),this.editorDiv.addEventListener("input",bt(this,S)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",bt(this,L)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",bt(this,_)),this.editorDiv.removeEventListener("focus",bt(this,p)),this.editorDiv.removeEventListener("blur",bt(this,J)),this.editorDiv.removeEventListener("input",bt(this,S)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Nt){this._focusEventsAllowed&&(super.focusin(Nt),Nt.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Nt;if(this.width){nl(this,xt,Ee).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Nt=this._initialOptions)!=null&&Nt.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Nt=bt(this,f),Ut=ul(this,f,nl(this,M,Gs).call(this).trimEnd());if(Nt===Ut)return;const Lt=Ht=>{if(ul(this,f,Ht),!Ht){this.remove();return}nl(this,H,Ue).call(this),this._uiManager.rebuild(this),nl(this,q,le).call(this)};this.addCommands({cmd:()=>{Lt(Ut)},undo:()=>{Lt(Nt)},mustExec:!1}),nl(this,q,le).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Nt){this.enterInEditMode()}keydown(Nt){Nt.target===this.div&&Nt.key==="Enter"&&(this.enterInEditMode(),Nt.preventDefault())}editorDivKeydown(Nt){Xt._keyboardManager.exec(this,Nt)}editorDivFocus(Nt){this.isEditing=!0}editorDivBlur(Nt){this.isEditing=!1}editorDivInput(Nt){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Nt,Ut;this.width&&(Nt=this.x,Ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",bt(this,L)),this.enableEditing(),B.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("aria-label",Ht)}),B.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("default-content",Ht)}),this.editorDiv.contentEditable=!0;const{style:Lt}=this.editorDiv;if(Lt.fontSize=`calc(${bt(this,g)}px * var(--scale-factor))`,Lt.color=bt(this,U),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,T.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Ht,Pt]=this.parentDimensions;if(this.annotationElementId){const{position:dt}=bt(this,I);let[w,k]=this.getInitialTranslation();[w,k]=this.pageTranslationToScreen(w,k);const[X,O]=this.pageDimensions,[Q,st]=this.pageTranslation;let et,Mt;switch(this.rotation){case 0:et=Nt+(dt[0]-Q)/X,Mt=Ut+this.height-(dt[1]-st)/O;break;case 90:et=Nt+(dt[0]-Q)/X,Mt=Ut-(dt[1]-st)/O,[w,k]=[k,-w];break;case 180:et=Nt-this.width+(dt[0]-Q)/X,Mt=Ut-(dt[1]-st)/O,[w,k]=[-w,-k];break;case 270:et=Nt+(dt[0]-Q-this.height*O)/X,Mt=Ut+(dt[1]-st-this.width*X)/O,[w,k]=[-k,w];break}this.setAt(et*Ht,Mt*Pt,w,k)}else this.setAt(Nt*Ht,Ut*Pt,this.width*Ht,this.height*Pt);nl(this,H,Ue).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Nt,Ut,Lt){let Ht=null;if(Nt instanceof v.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:dt,fontColor:w},rect:k,rotation:X,id:O},textContent:Q,textPosition:st,parent:{page:{pageNumber:et}}}=Nt;if(!Q||Q.length===0)return null;Ht=Nt={annotationType:m.AnnotationEditorType.FREETEXT,color:Array.from(w),fontSize:dt,value:Q.join(` diff --git a/src/front/dist/assets/DefaultPortal-41a2c92a.js b/src/front/dist/assets/DefaultPortal-41a2c92a.js deleted file mode 100644 index acbeb46db..000000000 --- a/src/front/dist/assets/DefaultPortal-41a2c92a.js +++ /dev/null @@ -1 +0,0 @@ -import{d as jt,r as x,c as ut,a as Lt,o as Dt,w as z,i as Te,b as $e,e as ke,f as w,u as V,h as It,j as Mt,k as qe,p as Ye,n as Ae,_ as se,l as Ie,m as ct,q as fe,s as $,t as P,v as d,x as i,V as W,y as L,z as U,A as Y,B as dt,C as Me,D as K,E as Z,F as vt,G as ft,H as mt,I as Bt,J as zt,K as ue,L as gt,M as B,N as Nt,O as Ht,P as Ft,Q as X,R as H,S as J,T as le,U as pe,W as Ut,X as Be,Y as Wt,Z as oe,$ as M,a0 as N,a1 as qt,a2 as Yt,a3 as ae,a4 as F,a5 as ce,a6 as je,a7 as me,a8 as ze,a9 as Gt,aa as ht,ab as Ve,ac as pt,ad as Xt,ae as yt,af as Se,ag as Kt,ah as q,ai as Zt,aj as wt,ak as _t,al as de,am as bt,an as ye,ao as $t,ap as Jt,aq as kt,ar as Qt,as as ea,at as ta,au as aa,av as na,aw as ra,ax as oa,ay as la,az as sa,aA as ia,aB as ua,aC as Ge,aD as ca,aE as Vt,aF as da,aG as va,aH as fa,aI as ma,aJ as ga,aK as ha,aL as pa,aM as ya,aN as wa,aO as _a,aP as ba}from"./index-84cc8e63.js";import{V as St}from"./VContainer-508c7a47.js";import{V as Xe}from"./VTextField-4eb073db.js";import{V as xt}from"./VSpacer-bea6911b.js";import{V as $a}from"./VAlert-e31488b7.js";import{F as ka,m as Va,V as Ke}from"./VToolbar-f40f893b.js";import{V as Sa}from"./VTextarea-08b60249.js";import{V as xa}from"./vcardUser-4537db13.js";import{V as we,a as Ca}from"./VList-d0850642.js";import{u as Ne}from"./ssrBoot-04c9ae84.js";/* empty css */import"./VField-e3c852c7.js";import"./VInput-e5a7e0e7.js";const Oa=jt("MainmenuStore",()=>{const e=x([]);return{portallinks:e,loadlinks:async()=>{const n=await ut.get("api/navigation/links/");e.value=n.data}}});function Ze(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function ee(e){for(var a=1;a1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(e).reduce((n,t)=>(a.includes(t)||(n[t]=V(e[t])),n),{})}function _e(e){return typeof e=="function"}function Pa(e){return It(e)||Mt(e)}function Ct(e,a,n){let t=e;const o=a.split(".");for(let l=0;le.some(t=>Ct(a,t,{[n]:!1})[n]))}function Qe(e,a,n){return w(()=>e.reduce((t,o)=>{const l=Ct(a,o,{[n]:!1})[n]||[];return t.concat(l)},[]))}function Ot(e,a,n,t){return e.call(t,V(a),V(n),t)}function Rt(e){return e.$valid!==void 0?!e.$valid:!e}function Ea(e,a,n,t,o,l,s){let{$lazy:u,$rewardEarly:c}=o,v=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],f=arguments.length>8?arguments[8]:void 0,m=arguments.length>9?arguments[9]:void 0,y=arguments.length>10?arguments[10]:void 0;const h=x(!!t.value),r=x(0);n.value=!1;const g=z([a,t].concat(v,y),()=>{if(u&&!t.value||c&&!m.value&&!n.value)return;let p;try{p=Ot(e,a,f,s)}catch(k){p=Promise.reject(k)}r.value++,n.value=!!r.value,h.value=!1,Promise.resolve(p).then(k=>{r.value--,n.value=!!r.value,l.value=k,h.value=Rt(k)}).catch(k=>{r.value--,n.value=!!r.value,l.value=k,h.value=!0})},{immediate:!0,deep:typeof a=="object"});return{$invalid:h,$unwatch:g}}function Ta(e,a,n,t,o,l,s,u){let{$lazy:c,$rewardEarly:v}=t;const f=()=>({}),m=w(()=>{if(c&&!n.value||v&&!u.value)return!1;let y=!0;try{const h=Ot(e,a,s,l);o.value=h,y=Rt(h)}catch(h){o.value=h}return y});return{$unwatch:f,$invalid:m}}function Aa(e,a,n,t,o,l,s,u,c,v,f){const m=x(!1),y=e.$params||{},h=x(null);let r,g;e.$async?{$invalid:r,$unwatch:g}=Ea(e.$validator,a,m,n,t,h,o,e.$watchTargets,c,v,f):{$invalid:r,$unwatch:g}=Ta(e.$validator,a,n,t,h,o,c,v);const p=e.$message;return{$message:_e(p)?w(()=>p(Je({$pending:m,$invalid:r,$params:Je(y),$model:a,$response:h,$validator:l,$propertyPath:u,$property:s}))):p||"",$params:y,$pending:m,$invalid:r,$response:h,$unwatch:g}}function ja(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const a=V(e),n=Object.keys(a),t={},o={},l={};let s=null;return n.forEach(u=>{const c=a[u];switch(!0){case _e(c.$validator):t[u]=c;break;case _e(c):t[u]={$validator:c};break;case u==="$validationGroups":s=c;break;case u.startsWith("$"):l[u]=c;break;default:o[u]=c}}),{rules:t,nestedValidators:o,config:l,validationGroups:s}}const La="__root";function Da(e,a,n,t,o,l,s,u,c){const v=Object.keys(e),f=t.get(o,e),m=x(!1),y=x(!1),h=x(0);if(f){if(!f.$partial)return f;f.$unwatch(),m.value=f.$dirty.value}const r={$dirty:m,$path:o,$touch:()=>{m.value||(m.value=!0)},$reset:()=>{m.value&&(m.value=!1)},$commit:()=>{}};return v.length?(v.forEach(g=>{r[g]=Aa(e[g],a,r.$dirty,l,s,g,n,o,c,y,h)}),r.$externalResults=w(()=>u.value?[].concat(u.value).map((g,p)=>({$propertyPath:o,$property:n,$validator:"$externalResults",$uid:`${o}-externalResult-${p}`,$message:g,$params:{},$response:null,$pending:!1})):[]),r.$invalid=w(()=>{const g=v.some(p=>V(r[p].$invalid));return y.value=g,!!r.$externalResults.value.length||g}),r.$pending=w(()=>v.some(g=>V(r[g].$pending))),r.$error=w(()=>r.$dirty.value?r.$pending.value||r.$invalid.value:!1),r.$silentErrors=w(()=>v.filter(g=>V(r[g].$invalid)).map(g=>{const p=r[g];return $e({$propertyPath:o,$property:n,$validator:g,$uid:`${o}-${g}`,$message:p.$message,$params:p.$params,$response:p.$response,$pending:p.$pending})}).concat(r.$externalResults.value)),r.$errors=w(()=>r.$dirty.value?r.$silentErrors.value:[]),r.$unwatch=()=>v.forEach(g=>{r[g].$unwatch()}),r.$commit=()=>{y.value=!0,h.value=Date.now()},t.set(o,e,r),r):(f&&t.set(o,e,r),r)}function Ia(e,a,n,t,o,l,s){const u=Object.keys(e);return u.length?u.reduce((c,v)=>(c[v]=Le({validations:e[v],state:a,key:v,parentKey:n,resultsCache:t,globalConfig:o,instance:l,externalResults:s}),c),{}):{}}function Ma(e,a,n){const t=w(()=>[a,n].filter(r=>r).reduce((r,g)=>r.concat(Object.values(V(g))),[])),o=w({get(){return e.$dirty.value||(t.value.length?t.value.every(r=>r.$dirty):!1)},set(r){e.$dirty.value=r}}),l=w(()=>{const r=V(e.$silentErrors)||[],g=t.value.filter(p=>(V(p).$silentErrors||[]).length).reduce((p,k)=>p.concat(...k.$silentErrors),[]);return r.concat(g)}),s=w(()=>{const r=V(e.$errors)||[],g=t.value.filter(p=>(V(p).$errors||[]).length).reduce((p,k)=>p.concat(...k.$errors),[]);return r.concat(g)}),u=w(()=>t.value.some(r=>r.$invalid)||V(e.$invalid)||!1),c=w(()=>t.value.some(r=>V(r.$pending))||V(e.$pending)||!1),v=w(()=>t.value.some(r=>r.$dirty)||t.value.some(r=>r.$anyDirty)||o.value),f=w(()=>o.value?c.value||u.value:!1),m=()=>{e.$touch(),t.value.forEach(r=>{r.$touch()})},y=()=>{e.$commit(),t.value.forEach(r=>{r.$commit()})},h=()=>{e.$reset(),t.value.forEach(r=>{r.$reset()})};return t.value.length&&t.value.every(r=>r.$dirty)&&m(),{$dirty:o,$errors:s,$invalid:u,$anyDirty:v,$error:f,$pending:c,$touch:m,$reset:h,$silentErrors:l,$commit:y}}function Le(e){let{validations:a,state:n,key:t,parentKey:o,childResults:l,resultsCache:s,globalConfig:u={},instance:c,externalResults:v}=e;const f=o?`${o}.${t}`:t,{rules:m,nestedValidators:y,config:h,validationGroups:r}=ja(a),g=ee(ee({},u),h),p=t?w(()=>{const E=V(n);return E?V(E[t]):void 0}):n,k=ee({},V(v)||{}),D=w(()=>{const E=V(v);return t?E?V(E[t]):void 0:E}),S=Da(m,p,t,s,f,g,c,D,n),R=Ia(y,p,f,s,g,c,D),I={};r&&Object.entries(r).forEach(E=>{let[Q,T]=E;I[Q]={$invalid:Ee(T,R,"$invalid"),$error:Ee(T,R,"$error"),$pending:Ee(T,R,"$pending"),$errors:Qe(T,R,"$errors"),$silentErrors:Qe(T,R,"$silentErrors")}});const{$dirty:_,$errors:b,$invalid:C,$anyDirty:O,$error:j,$pending:A,$touch:G,$reset:ne,$silentErrors:Ce,$commit:ie}=Ma(S,R,l),Oe=t?w({get:()=>V(p),set:E=>{_.value=!0;const Q=V(n),T=V(v);T&&(T[t]=k[t]),Te(Q[t])?Q[t].value=E:Q[t]=E}}):null;t&&g.$autoDirty&&z(p,()=>{_.value||G();const E=V(v);E&&(E[t]=k[t])},{flush:"sync"});async function Re(){return G(),g.$rewardEarly&&(ie(),await Ae()),await Ae(),new Promise(E=>{if(!A.value)return E(!C.value);const Q=z(A,()=>{E(!C.value),Q()})})}function ge(E){return(l.value||{})[E]}function Pe(){Te(v)?v.value=k:Object.keys(k).length===0?Object.keys(v).forEach(E=>{delete v[E]}):Object.assign(v,k)}return $e(ee(ee(ee({},S),{},{$model:Oe,$dirty:_,$error:j,$errors:b,$invalid:C,$anyDirty:O,$pending:A,$touch:G,$reset:ne,$path:f||La,$silentErrors:Ce,$validate:Re,$commit:ie},l&&{$getResultsForChild:ge,$clearExternalResults:Pe,$validationGroups:I}),R))}class Ba{constructor(){this.storage=new Map}set(a,n,t){this.storage.set(a,{rules:n,result:t})}checkRulesValidity(a,n,t){const o=Object.keys(t),l=Object.keys(n);return l.length!==o.length||!l.every(u=>o.includes(u))?!1:l.every(u=>n[u].$params?Object.keys(n[u].$params).every(c=>V(t[u].$params[c])===V(n[u].$params[c])):!0)}get(a,n){const t=this.storage.get(a);if(!t)return;const{rules:o,result:l}=t,s=this.checkRulesValidity(a,n,o),u=l.$unwatch?l.$unwatch:()=>({});return s?l:{$dirty:l.$dirty,$partial:!0,$unwatch:u}}}const he={COLLECT_ALL:!0,COLLECT_NONE:!1},et=Symbol("vuelidate#injectChildResults"),tt=Symbol("vuelidate#removeChildResults");function za(e){let{$scope:a,instance:n}=e;const t={},o=x([]),l=w(()=>o.value.reduce((f,m)=>(f[m]=V(t[m]),f),{}));function s(f,m){let{$registerAs:y,$scope:h,$stopPropagation:r}=m;r||a===he.COLLECT_NONE||h===he.COLLECT_NONE||a!==he.COLLECT_ALL&&a!==h||(t[y]=f,o.value.push(y))}n.__vuelidateInjectInstances=[].concat(n.__vuelidateInjectInstances||[],s);function u(f){o.value=o.value.filter(m=>m!==f),delete t[f]}n.__vuelidateRemoveInstances=[].concat(n.__vuelidateRemoveInstances||[],u);const c=qe(et,[]);Ye(et,n.__vuelidateInjectInstances);const v=qe(tt,[]);return Ye(tt,n.__vuelidateRemoveInstances),{childResults:l,sendValidationResultsToParent:c,removeValidationResultsFromParent:v}}function Pt(e){return new Proxy(e,{get(a,n){return typeof a[n]=="object"?Pt(a[n]):w(()=>a[n])}})}let at=0;function Na(e,a){var n;let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(t=e,e=void 0,a=void 0);let{$registerAs:o,$scope:l=he.COLLECT_ALL,$stopPropagation:s,$externalResults:u,currentVueInstance:c}=t;const v=c||((n=Lt())===null||n===void 0?void 0:n.proxy),f=v?v.$options:{};o||(at+=1,o=`_vuelidate_${at}`);const m=x({}),y=new Ba,{childResults:h,sendValidationResultsToParent:r,removeValidationResultsFromParent:g}=v?za({$scope:l,instance:v}):{childResults:x({})};if(!e&&f.validations){const p=f.validations;a=x({}),Dt(()=>{a.value=v,z(()=>_e(p)?p.call(a.value,new Pt(a.value)):p,k=>{m.value=Le({validations:k,state:a,childResults:h,resultsCache:y,globalConfig:t,instance:v,externalResults:u||v.vuelidateExternalResults})},{immediate:!0})}),t=f.validationsConfig||t}else{const p=Te(e)||Pa(e)?e:$e(e||{});z(p,k=>{m.value=Le({validations:k,state:a,childResults:h,resultsCache:y,globalConfig:t,instance:v??{},externalResults:u})},{immediate:!0})}return v&&(r.forEach(p=>p(m,{$registerAs:o,$scope:l,$stopPropagation:s})),ke(()=>g.forEach(p=>p(o)))),w(()=>ee(ee({},V(m.value)),h.value))}function nt(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function ve(e){for(var a=1;a1&&arguments[1]!==void 0?arguments[1]:[];const n=xe(e);return ve(ve({},n),{},{$async:!0,$watchTargets:a})}function qa(e){return{$validator(a){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o{const c=Object.entries(s).reduce((v,f)=>{let[m,y]=f;const h=e[m]||{},r=Object.entries(h).reduce((g,p)=>{let[k,D]=p;const R=Tt(D).call(this,y,s,u,...t),I=Et(R);if(g.$data[k]=R,g.$data.$invalid=!I||!!g.$data.$invalid,g.$data.$error=g.$data.$invalid,!I){let _=D.$message||"";const b=D.$params||{};typeof _=="function"&&(_=_({$pending:!1,$invalid:!I,$params:b,$model:y,$response:R})),g.$errors.push({$property:m,$message:_,$params:b,$response:R,$model:y,$pending:!1,$validator:k})}return{$valid:g.$valid&&I,$data:g.$data,$errors:g.$errors}},{$valid:!0,$data:{},$errors:[]});return v.$data[m]=r.$data,v.$errors[m]=r.$errors,{$valid:v.$valid&&r.$valid,$data:v.$data,$errors:v.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:l.$valid&&c.$valid,$data:l.$data.concat(c.$data),$errors:l.$errors.concat(c.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:a=>{let{$response:n}=a;return n?n.$errors.map(t=>Object.values(t).map(o=>o.map(l=>l.$message)).reduce((o,l)=>o.concat(l),[])):[]}}}const He=e=>{if(e=V(e),Array.isArray(e))return!!e.length;if(e==null)return!1;if(e===!1)return!0;if(e instanceof Date)return!isNaN(e.getTime());if(typeof e=="object"){for(let a in e)return!0;return!1}return!!String(e).length},Ya=e=>(e=V(e),Array.isArray(e)?e.length:typeof e=="object"?Object.keys(e).length:String(e).length);function te(){for(var e=arguments.length,a=new Array(e),n=0;n(t=V(t),!He(t)||a.every(o=>(o.lastIndex=0,o.test(t))))}var At=Object.freeze({__proto__:null,forEach:qa,len:Ya,normalizeValidatorObject:xe,regex:te,req:He,unwrap:V,unwrapNormalizedValidator:Tt,unwrapValidatorResponse:Et,withAsync:Wa,withMessage:Ua,withParams:Fa});te(/^[a-zA-Z]*$/);te(/^[a-zA-Z0-9]*$/);te(/^\d*(\.\d+)?$/);const Ga=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;te(Ga);function Xa(e){return typeof e=="string"&&(e=e.trim()),He(e)}var Ka={$validator:Xa,$message:"Value is required",$params:{type:"required"}};const Za=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[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]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;te(Za);te(/(^[0-9]*$)|(^-[0-9]+$)/);te(/^[-]?\d*(\.\d+)?$/);const rt=At.withMessage("Обязательное поле",Ka),Ja={setup(e,a){const n=Ie(),t=ct(),o=x(!1),l=x(""),s=x(!1),u=x(!1),c=$e({username:"9966-00-",password:""}),v=w(()=>({username:{req:rt,latin:At.withMessage(()=>'Логин имееет вид "0000-00-000"',h=>/(\d{4,4}[-]\d{2,2}[-]\d{3,3})+$/.test(h.toString()))},password:{req:rt}})),f=Na(v,c),m=h=>f.value[h].$error?f.value[h].$errors[0].$message:"",y=async()=>{if(f.value.$error)console.log(!0);else try{await n.logging(c)}catch{t.loading=!1,s.value=!0,l.value="Ошибка авторизации"}};return fe(()=>{f.value.$validate()}),{accountStore:n,AppStore:t,menuAuthDialog:o,anon:c,v$:f,logging:y,errorer:m,alert:s,err:l,eyeshow:u}}},Qa=B("span",{class:"text-h5"},"Вход в портал",-1);function en(e,a,n,t,o,l){return $(),P(gt,{modelValue:t.menuAuthDialog,"onUpdate:modelValue":a[6]||(a[6]=s=>t.menuAuthDialog=s),persistent:"",width:"400"},{activator:d(({props:s})=>[i(Y,U(s,{"append-icon":"mdi-login",color:"black_and_white"}),{prepend:d(()=>[i(W,{color:"black_and_white"})]),append:d(()=>[i(W,{color:"black_and_white"})]),default:d(()=>[L(" Войти ")]),_:2},1040)]),default:d(()=>[i(ue,{onKeyup:zt(t.logging,["enter"])},{default:d(()=>[i(dt,null,{default:d(()=>[Qa]),_:1}),i(Me,null,{default:d(()=>[i(St,null,{default:d(()=>[i(K,null,{default:d(()=>[i(Z,{cols:"12",class:"py-0"},{default:d(()=>[i(Xe,{modelValue:t.anon.username,"onUpdate:modelValue":a[0]||(a[0]=s=>t.anon.username=s),label:"Логин",variant:"underlined","error-messages":t.errorer("username")},null,8,["modelValue","error-messages"])]),_:1}),i(Z,{cols:"12",class:"py-0"},{default:d(()=>[i(Xe,{type:t.eyeshow?"text":"password",modelValue:t.anon.password,"onUpdate:modelValue":a[2]||(a[2]=s=>t.anon.password=s),label:"Пароль",variant:"underlined","error-messages":t.errorer("password"),"onClick:appendInner":a[3]||(a[3]=s=>t.eyeshow=!t.eyeshow)},{"append-inner":d(()=>[i(W,{size:"x-small",icon:t.eyeshow?"mdi-eye":"mdi-eye-off",onClick:a[1]||(a[1]=s=>t.eyeshow=!t.eyeshow)},null,8,["icon"])]),_:1},8,["type","modelValue","error-messages"])]),_:1})]),_:1})]),_:1})]),_:1}),i(vt,null,{default:d(()=>[i(xt),i(Y,{color:"modal_btn",variant:"text",onClick:a[4]||(a[4]=s=>t.menuAuthDialog=!1)},{default:d(()=>[L(" Отмена ")]),_:1}),i(Y,{color:"modal_btn",variant:"text",onClick:t.logging},{default:d(()=>[L(" Войти ")]),_:1},8,["onClick"])]),_:1}),ft(i(Bt,{location:"bottom",absolute:"",indeterminate:""},null,512),[[mt,t.AppStore.loading&&!t.alert]])]),_:1},8,["onKeyup"]),i($a,{width:"400",position:"fixed",class:"bottom-alertauth bgerroralert",type:"error",density:"compact",title:"Ошибка авторизации",text:e.info,modelValue:t.alert,"onUpdate:modelValue":a[5]||(a[5]=s=>t.alert=s),closable:""},{prepend:d(()=>[i(W,{icon:"mdi-alert-outline",class:"pt-1"})]),_:1},8,["text","modelValue"])]),_:1},8,["modelValue"])}const tn=se(Ja,[["render",en]]),an={setup(){const e=x({}),a=x(!1),n={onliner:function(u){let c=new Set(u),v=Array.from(c);v.splice(v.findIndex(f=>f==t.user.login),1),o.value=v}},t=Ie();let o=x([]);const l=new WebSocket(Nt+"ws/watcher/?token="+localStorage.access),s=u=>{a.value=!0,pe.get(`api/accounts/getuser/?userlogin=${u}`).then(c=>{e.value={department:c.data.department,fio:c.data.fio,post:c.data.post,email:c.data.email,tel:c.data.tel,room:c.data.room,login:c.data.login}})};return l.onmessage=u=>{let c=JSON.parse(u.data);n[c.message.action](c.message.data)},z(()=>t.cod2user,function(){t.cod2user.value||l.close()}),{author:e,open:a,onlineuser:o,checkremote:Ht,spravURL:Ft,whatuser:s,accountStore:t}}},nn={class:"align-center d-flex flex-column py-1"};function rn(e,a,n,t,o,l){const s=X("info-user-card");return $(),H("div",nn,[($(!0),H(J,null,le(t.onlineuser,u=>($(),P(Y,{variant:"text",key:u,height:"50"},{default:d(()=>[i(Ut,{size:"36px"},{default:d(()=>[i(Be,{src:t.checkremote(`${t.spravURL}${u}.jpg`),onClick:c=>t.whatuser(u)},null,8,["src","onClick"])]),_:2},1024)]),_:2},1024))),128)),i(s,{author:t.author,opendialog:t.open,"onUpdate:opendialog":a[0]||(a[0]=u=>t.open=u)},null,8,["author","opendialog"])])}const on=se(an,[["render",rn]]);const ln={components:{FeedstarLike:ka},props:{LikeDialog:{type:Boolean,default:!1}},setup(e,{emit:a}){const n=Wt().alert,t=x({nowcomment:{comment:""},nowrating:[]});function o(){pe.get("api/feedback/feedbackdata/").then(f=>{if(t.value=f.data,t.value.nowrating.length==0)for(let m of t.value.basecrit)t.value.nowrating.push({rating:m.rating,crit:m.id,id:null});t.value.nowcomment===null&&(t.value.nowcomment={comment:"",id:null})})}fe(()=>{o()});const l=w(()=>{const m=t.value.nowrating.reduce((h,r)=>h+r.rating,0)/t.value.nowrating.length;return Number.isInteger(m)?m:m.toFixed(1)});function s(){let f="";return l.value>0&&l.value<=3?f="УПС-С! Мы обязательно все исправим":l.value>2&&l.value<=4?f="Спасибо за обратную связь, мы обратим на это внимание":l.value>4&&l.value<5?f="Класс, будем стараться до 5":f="Спасибо за отзыв и высокую оценку ^__^",f}function u(){a("menusClose")}function c(){pe.post("api/feedback/feedbackdata/",{nowrating:t.value.nowrating,nowcomment:t.value.nowcomment}).then(f=>{}),n.alert=!0,v(),u()}const v=()=>{t.value.nowcomment.id==null?(n.text="Оценка отправлена, спасибо за участие",n.ico="mdi-redo-variant",n.color="green-darken-4"):(n.text="Оценка обновлена",n.ico="mdi-refresh",n.color="light-blue-darken-4")};return{feedbackdata:t,average:l,menusCloses:u,myLabel:s,feedSend:c,feedalert:n}}},sn=B("span",{class:"text-h5"},"Обратная связь",-1),un={key:0,class:"pl-5"},cn={class:"font-weight-black"};function dn(e,a,n,t,o,l){const s=X("feedstar-like");return $(),P(ue,{class:"pt-2"},{default:d(()=>[i(dt,null,{default:d(()=>[sn]),_:1}),i(Me,{class:"px-2 py-0"},{default:d(()=>[i(St,null,{default:d(()=>[i(K,null,{default:d(()=>[i(Z,{class:"flex-grow-0 py-0 text-no-wrap align-self-center text-button"},{default:d(()=>[L(" Оцените сайт ")]),_:1}),i(oe,{class:"pb-3"})]),_:1}),i(s,{rating:t.feedbackdata,"onUpdate:rating":a[0]||(a[0]=u=>t.feedbackdata.nowrating=u)},null,8,["rating"]),i(K,{class:"mt-6"},{default:d(()=>[i(Z,{class:"pa-0 px-3"},{default:d(()=>[i(Sa,{label:"Ваши комментарии сделают портал лучше","hide-details":"",variant:"outlined",rows:"5","row-height":"15",modelValue:t.feedbackdata.nowcomment.comment,"onUpdate:modelValue":a[1]||(a[1]=u=>t.feedbackdata.nowcomment.comment=u)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),i(vt,{class:"pt-0"},{default:d(()=>[t.average<5||t.feedbackdata.nowcomment.id!=null?($(),H("small",un,[L(" Вы оценили сайт на "),B("span",cn,M(t.average),1),L(" "+M(t.myLabel()),1)])):N("",!0),i(xt),i(Y,{color:"modal_btn",variant:"text",text:"Закрыть",onClick:t.menusCloses},null,8,["onClick"]),i(Y,{color:"modal_btn",variant:"text",text:t.feedbackdata.nowcomment.id==null?"Отправить":"Обновить",onClick:t.feedSend},null,8,["text","onClick"])]),_:1})]),_:1})}const vn=se(ln,[["render",dn]]),fn={name:"PageCounter",props:{rail:{type:Boolean,default:!1}},setup(){const e=qt(),a=ct(),n=x(!1);return{router:e,appStore:a,showTooltip:n,formatComa:Yt}}},mn={class:"text-caption"},gn=B("br",null,null,-1),hn=B("br",null,null,-1),pn={class:"cursor-default"},yn={class:"cursor-default"},wn={class:"cursor-default"};function _n(e,a,n,t,o,l){return $(),P(we,{class:"pa-0"},{default:d(()=>[n.rail?($(),P(ae,{key:1,class:"align-center"},{default:d(()=>[i(F,{modelValue:t.showTooltip,"onUpdate:modelValue":a[0]||(a[0]=s=>t.showTooltip=s),location:"top"},{activator:d(({props:s})=>[i(W,U(s,{color:"grey"}),{default:d(()=>[L(" mdi-account-eye ")]),_:2},1040)]),default:d(()=>[B("p",null,"Посещений всего: "+M(t.appStore.countvisitor.totalvisit),1),i(oe),B("p",null,"Посещений сегодня: "+M(t.appStore.countvisitor.visittoday),1),i(oe),B("p",null,"Из них уникальных: "+M(t.appStore.countvisitor.uniqtoday),1)]),_:1},8,["modelValue"])]),_:1})):($(),P(ae,{key:0,class:"text-caption font-weight-bold text-truncate"},{default:d(()=>[i(F,null,{activator:d(({props:s})=>[i(W,U({icon:"mdi-information",color:"cyan-darken-3",size:"12",class:"cursor-help"},s),null,16)]),default:d(()=>[B("span",mn,[L(" Информация о странице: "),gn,L(" "+M(t.router.currentRoute.value.meta.title)+" ",1),hn,L(" с "+M(t.formatComa(t.appStore.countvisitor.visitdate)),1)])]),_:1}),B("p",pn,"Посещений всего: "+M(t.appStore.countvisitor.totalvisit),1),i(oe),B("p",yn,"Посещений сегодня: "+M(t.appStore.countvisitor.visittoday),1),i(oe),B("p",wn,"Из них уникальных: "+M(t.appStore.countvisitor.uniqtoday),1),i(oe)]),_:1}))]),_:1})}const bn=se(fn,[["render",_n]]),$n={props:{rail:{type:Boolean,default:!1}},setup(){const e=()=>ce=="http://127.0.0.1:8000/"?"http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects":"http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22";return{aMenuItem:{prom:[{name:"Панель администратора",ico:"mdi-wrench",link:ce+"admin"}],my:[{name:"Gitt",ico:"mdi-github",link:e()},{name:"Swagger",ico:"mdi-puzzle",link:"http://127.0.0.1:8000/swagger/"}]},getDevelopment:je,showProm:t=>{let o=!0;return t=="my"&&je()==!1&&(o=!1),o}}}},kn={key:0};function Vn(e,a,n,t,o,l){return $(),H("div",null,[i(we,{nav:"",density:"compact",class:"text-blue-grey-lighten-1"},{default:d(()=>[($(!0),H(J,null,le(t.aMenuItem,(s,u)=>($(),H("div",{key:u},[t.showProm(u)?($(),H("div",kn,[($(!0),H(J,null,le(s,c=>($(),P(ae,{key:c,title:c.name,value:c.name,href:c.link,target:c.link?"_blank":"",slim:""},{prepend:d(()=>[i(W,{icon:c.ico,size:"x_small"},null,8,["icon"]),n.rail?($(),P(F,{key:0,activator:"parent",location:"top"})):N("",!0)]),_:2},1032,["title","value","href","target"]))),128))])):N("",!0)]))),128))]),_:1})])}const Sn=se($n,[["render",Vn]]);const xn=me({...ze(),...Gt({fullHeight:!0}),...ht()},"VApp"),Cn=Ve()({name:"VApp",props:xn(),setup(e,a){let{slots:n}=a;const t=pt(e),{layoutClasses:o,getLayoutItem:l,items:s,layoutRef:u}=Xt(e),{rtlClasses:c}=yt();return Se(()=>i("div",{ref:u,class:["v-application",t.themeClasses.value,o.value,c.value,e.class],style:[e.style]},[i("div",{class:"v-application__wrap"},[i(Kt,null,{default:()=>{var v;return[i(J,null,[(v=n.default)==null?void 0:v.call(n)])]}})])])),{getLayoutItem:l,items:s,theme:t}}});const On=me({scrollTarget:{type:String},scrollThreshold:{type:[String,Number],default:300}},"scroll");function Rn(e){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{canScroll:n}=a;let t=0,o=0;const l=x(null),s=q(0),u=q(0),c=q(0),v=q(!1),f=q(!1),m=w(()=>Number(e.scrollThreshold)),y=w(()=>Zt((m.value-s.value)/m.value||0)),h=()=>{const r=l.value;if(!r||n&&!n.value)return;t=s.value,s.value="window"in r?r.pageYOffset:r.scrollTop;const g=r instanceof Window?document.documentElement.scrollHeight:r.scrollHeight;if(o!==g){o=g;return}f.value=s.value{u.value=u.value||s.value}),z(v,()=>{u.value=0}),fe(()=>{z(()=>e.scrollTarget,r=>{var p;const g=r?document.querySelector(r):window;g&&g!==l.value&&((p=l.value)==null||p.removeEventListener("scroll",h),l.value=g,l.value.addEventListener("scroll",h,{passive:!0}))},{immediate:!0})}),ke(()=>{var r;(r=l.value)==null||r.removeEventListener("scroll",h)}),n&&z(n,h,{immediate:!0}),{scrollThreshold:m,currentScroll:s,currentThreshold:c,isScrollActive:v,scrollRatio:y,isScrollingUp:f,savedScroll:u}}const Pn=me({scrollBehavior:String,modelValue:{type:Boolean,default:!0},location:{type:String,default:"top",validator:e=>["top","bottom"].includes(e)},...Va(),...wt(),...On(),height:{type:[Number,String],default:64}},"VAppBar"),En=Ve()({name:"VAppBar",props:Pn(),emits:{"update:modelValue":e=>!0},setup(e,a){let{slots:n}=a;const t=x(),o=_t(e,"modelValue"),l=w(()=>{var R;const S=new Set(((R=e.scrollBehavior)==null?void 0:R.split(" "))??[]);return{hide:S.has("hide"),fullyHide:S.has("fully-hide"),inverted:S.has("inverted"),collapse:S.has("collapse"),elevate:S.has("elevate"),fadeImage:S.has("fade-image")}}),s=w(()=>{const S=l.value;return S.hide||S.fullyHide||S.inverted||S.collapse||S.elevate||S.fadeImage||!o.value}),{currentScroll:u,scrollThreshold:c,isScrollingUp:v,scrollRatio:f}=Rn(e,{canScroll:s}),m=w(()=>l.value.hide||l.value.fullyHide),y=w(()=>e.collapse||l.value.collapse&&(l.value.inverted?f.value>0:f.value===0)),h=w(()=>e.flat||l.value.fullyHide&&!o.value||l.value.elevate&&(l.value.inverted?u.value>0:u.value===0)),r=w(()=>l.value.fadeImage?l.value.inverted?1-f.value:f.value:void 0),g=w(()=>{var I,_;const S=Number(((I=t.value)==null?void 0:I.contentHeight)??e.height),R=Number(((_=t.value)==null?void 0:_.extensionHeight)??0);return m.value?u.value!!e.scrollBehavior),()=>{$t(()=>{m.value?l.value.inverted?o.value=u.value>c.value:o.value=v.value||u.valueparseInt(e.order,10)),position:ye(e,"location"),layoutSize:g,elementSize:q(void 0),active:o,absolute:ye(e,"absolute")});return Se(()=>{const S=Ke.filterProps(e);return i(Ke,U({ref:t,class:["v-app-bar",{"v-app-bar--bottom":e.location==="bottom"},e.class],style:[{...k.value,"--v-toolbar-image-opacity":r.value,height:void 0,...p.value},e.style]},S,{collapse:y.value,flat:h.value}),n)}),D}});const Tn=me({scrollable:Boolean,...ze(),...Jt(),...kt({tag:"main"})},"VMain"),ot=Ve()({name:"VMain",props:Tn(),setup(e,a){let{slots:n}=a;const{dimensionStyles:t}=Qt(e),{mainStyles:o,layoutIsReady:l}=ea(),{ssrBootStyles:s}=Ne();return Se(()=>i(e.tag,{class:["v-main",{"v-main--scrollable":e.scrollable},e.class],style:[o.value,s.value,t.value,e.style]},{default:()=>{var u,c;return[e.scrollable?i("div",{class:"v-main__scroller"},[(u=n.default)==null?void 0:u.call(n)]):(c=n.default)==null?void 0:c.call(n)]}})),l}});function An(e){let{rootEl:a,isSticky:n,layoutItemStyles:t}=e;const o=q(!1),l=q(0),s=w(()=>{const v=typeof o.value=="boolean"?"top":o.value;return[n.value?{top:"auto",bottom:"auto",height:void 0}:void 0,o.value?{[v]:ta(l.value)}:{top:t.value.top}]});fe(()=>{z(n,v=>{v?window.addEventListener("scroll",c,{passive:!0}):window.removeEventListener("scroll",c)},{immediate:!0})}),ke(()=>{window.removeEventListener("scroll",c)});let u=0;function c(){const v=u>window.scrollY?"up":"down",f=a.value.getBoundingClientRect(),m=parseFloat(t.value.top??0),y=window.scrollY-Math.max(0,l.value-m),h=f.height+Math.max(l.value,m)-window.scrollY-window.innerHeight,r=parseFloat(getComputedStyle(a.value).getPropertyValue("--v-body-scroll-y"))||0;f.height0;n--){if(e[n].t===e[n-1].t)continue;const t=lt(a),o=(e[n].d-e[n-1].d)/(e[n].t-e[n-1].t);a+=(o-t)*Math.abs(o),n===e.length-1&&(a*=.5)}return lt(a)*1e3}function Dn(){const e={};function a(o){Array.from(o.changedTouches).forEach(l=>{(e[l.identifier]??(e[l.identifier]=new aa(Ln))).push([o.timeStamp,l])})}function n(o){Array.from(o.changedTouches).forEach(l=>{delete e[l.identifier]})}function t(o){var v;const l=(v=e[o])==null?void 0:v.values().reverse();if(!l)throw new Error(`No samples for touch id ${o}`);const s=l[0],u=[],c=[];for(const f of l){if(s[0]-f[0]>jn)break;u.push({t:f[0],d:f[1].clientX}),c.push({t:f[0],d:f[1].clientY})}return{x:st(u),y:st(c),get direction(){const{x:f,y:m}=this,[y,h]=[Math.abs(f),Math.abs(m)];return y>h&&f>=0?"right":y>h&&f<=0?"left":h>y&&m>=0?"down":h>y&&m<=0?"up":In()}}}return{addMovement:a,endTouch:n,getVelocity:t}}function In(){throw new Error}function Mn(e){let{el:a,isActive:n,isTemporary:t,width:o,touchless:l,position:s}=e;fe(()=>{window.addEventListener("touchstart",D,{passive:!0}),window.addEventListener("touchmove",S,{passive:!1}),window.addEventListener("touchend",R,{passive:!0})}),ke(()=>{window.removeEventListener("touchstart",D),window.removeEventListener("touchmove",S),window.removeEventListener("touchend",R)});const u=w(()=>["left","right"].includes(s.value)),{addMovement:c,endTouch:v,getVelocity:f}=Dn();let m=!1;const y=q(!1),h=q(0),r=q(0);let g;function p(_,b){return(s.value==="left"?_:s.value==="right"?document.documentElement.clientWidth-_:s.value==="top"?_:s.value==="bottom"?document.documentElement.clientHeight-_:re())-(b?o.value:0)}function k(_){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const C=s.value==="left"?(_-r.value)/o.value:s.value==="right"?(document.documentElement.clientWidth-_-r.value)/o.value:s.value==="top"?(_-r.value)/o.value:s.value==="bottom"?(document.documentElement.clientHeight-_-r.value)/o.value:re();return b?Math.max(0,Math.min(1,C)):C}function D(_){if(l.value)return;const b=_.changedTouches[0].clientX,C=_.changedTouches[0].clientY,O=25,j=s.value==="left"?bdocument.documentElement.clientWidth-O:s.value==="top"?Cdocument.documentElement.clientHeight-O:re(),A=n.value&&(s.value==="left"?bdocument.documentElement.clientWidth-o.value:s.value==="top"?Cdocument.documentElement.clientHeight-o.value:re());(j||A||n.value&&t.value)&&(g=[b,C],r.value=p(u.value?b:C,n.value),h.value=k(u.value?b:C),m=r.value>-20&&r.value<80,v(_),c(_))}function S(_){const b=_.changedTouches[0].clientX,C=_.changedTouches[0].clientY;if(m){if(!_.cancelable){m=!1;return}const j=Math.abs(b-g[0]),A=Math.abs(C-g[1]);(u.value?j>A&&j>3:A>j&&A>3)?(y.value=!0,m=!1):(u.value?A:j)>3&&(m=!1)}if(!y.value)return;_.preventDefault(),c(_);const O=k(u.value?b:C,!1);h.value=Math.max(0,Math.min(1,O)),O>1?r.value=p(u.value?b:C,!0):O<0&&(r.value=p(u.value?b:C,!1))}function R(_){if(m=!1,!y.value)return;c(_),y.value=!1;const b=f(_.changedTouches[0].identifier),C=Math.abs(b.x),O=Math.abs(b.y);(u.value?C>O&&C>400:O>C&&O>3)?n.value=b.direction===({left:"right",right:"left",top:"down",bottom:"up"}[s.value]||re()):n.value=h.value>.5}const I=w(()=>y.value?{transform:s.value==="left"?`translateX(calc(-100% + ${h.value*o.value}px))`:s.value==="right"?`translateX(calc(100% - ${h.value*o.value}px))`:s.value==="top"?`translateY(calc(-100% + ${h.value*o.value}px))`:s.value==="bottom"?`translateY(calc(100% - ${h.value*o.value}px))`:re(),transition:"none"}:void 0);return de(y,()=>{var C,O;const _=((C=a.value)==null?void 0:C.style.transform)??null,b=((O=a.value)==null?void 0:O.style.transition)??null;$t(()=>{var j,A,G,ne;(A=a.value)==null||A.style.setProperty("transform",((j=I.value)==null?void 0:j.transform)||"none"),(ne=a.value)==null||ne.style.setProperty("transition",((G=I.value)==null?void 0:G.transition)||null)}),na(()=>{var j,A;(j=a.value)==null||j.style.setProperty("transform",_),(A=a.value)==null||A.style.setProperty("transition",b)})}),{isDragging:y,dragProgress:h,dragStyles:I}}function re(){throw new Error}const Bn=["start","end","left","right","top","bottom"],zn=me({color:String,disableResizeWatcher:Boolean,disableRouteWatcher:Boolean,expandOnHover:Boolean,floating:Boolean,modelValue:{type:Boolean,default:null},permanent:Boolean,rail:{type:Boolean,default:null},railWidth:{type:[Number,String],default:56},scrim:{type:[Boolean,String],default:!0},image:String,temporary:Boolean,persistent:Boolean,touchless:Boolean,width:{type:[Number,String],default:256},location:{type:String,default:"start",validator:e=>Bn.includes(e)},sticky:Boolean,...ra(),...ze(),...oa(),...la({mobile:null}),...sa(),...wt(),...ia(),...kt({tag:"nav"}),...ht()},"VNavigationDrawer"),it=Ve()({name:"VNavigationDrawer",props:zn(),emits:{"update:modelValue":e=>!0,"update:rail":e=>!0},setup(e,a){let{attrs:n,emit:t,slots:o}=a;const{isRtl:l}=yt(),{themeClasses:s}=pt(e),{borderClasses:u}=ua(e),{backgroundColorClasses:c,backgroundColorStyles:v}=Ge(ye(e,"color")),{elevationClasses:f}=ca(e),{displayClasses:m,mobile:y}=Vt(e),{roundedClasses:h}=da(e),r=va(),g=_t(e,"modelValue",null,T=>!!T),{ssrBootStyles:p}=Ne(),{scopeId:k}=fa(),D=x(),S=q(!1),{runOpenDelay:R,runCloseDelay:I}=ya(e,T=>{S.value=T}),_=w(()=>e.rail&&e.expandOnHover&&S.value?Number(e.width):Number(e.rail?e.railWidth:e.width)),b=w(()=>ma(e.location,l.value)),C=w(()=>e.persistent),O=w(()=>!e.permanent&&(y.value||e.temporary)),j=w(()=>e.sticky&&!O.value&&b.value!=="bottom");de(()=>e.expandOnHover&&e.rail!=null,()=>{z(S,T=>t("update:rail",!T))}),de(()=>!e.disableResizeWatcher,()=>{z(O,T=>!e.permanent&&Ae(()=>g.value=!T))}),de(()=>!e.disableRouteWatcher&&!!r,()=>{z(r.currentRoute,()=>O.value&&(g.value=!1))}),z(()=>e.permanent,T=>{T&&(g.value=!0)}),e.modelValue==null&&!O.value&&(g.value=e.permanent||!y.value);const{isDragging:A,dragProgress:G}=Mn({el:D,isActive:g,isTemporary:O,width:_,touchless:ye(e,"touchless"),position:b}),ne=w(()=>{const T=O.value?0:e.rail&&e.expandOnHover?Number(e.railWidth):_.value;return A.value?T*G.value:T}),Ce=w(()=>["top","bottom"].includes(e.location)?0:_.value),{layoutItemStyles:ie,layoutItemScrimStyles:Oe,layoutIsReady:Re}=bt({id:e.name,order:w(()=>parseInt(e.order,10)),position:b,layoutSize:ne,elementSize:Ce,active:w(()=>g.value||A.value),disableTransitions:w(()=>A.value),absolute:w(()=>e.absolute||j.value&&typeof ge.value!="string")}),{isStuck:ge,stickyStyles:Pe}=An({rootEl:D,isSticky:j,layoutItemStyles:ie}),E=Ge(w(()=>typeof e.scrim=="string"?e.scrim:null)),Q=w(()=>({...A.value?{opacity:G.value*.2,transition:"none"}:void 0,...Oe.value}));return ga({VList:{bgColor:"transparent"}}),Se(()=>{const T=o.image||e.image;return i(J,null,[i(e.tag,U({ref:D,onMouseenter:R,onMouseleave:I,class:["v-navigation-drawer",`v-navigation-drawer--${b.value}`,{"v-navigation-drawer--expand-on-hover":e.expandOnHover,"v-navigation-drawer--floating":e.floating,"v-navigation-drawer--is-hovering":S.value,"v-navigation-drawer--rail":e.rail,"v-navigation-drawer--temporary":O.value,"v-navigation-drawer--persistent":C.value,"v-navigation-drawer--active":g.value,"v-navigation-drawer--sticky":j.value},s.value,c.value,u.value,m.value,f.value,h.value,e.class],style:[v.value,ie.value,p.value,Pe.value,e.style,["top","bottom"].includes(b.value)?{height:"auto"}:{}]},k,n),{default:()=>{var Fe,Ue,We;return[T&&i("div",{key:"image",class:"v-navigation-drawer__img"},[o.image?i(ha,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{alt:"",cover:!0,height:"inherit",src:e.image}}},o.image):i(Be,{key:"image-img",alt:"",cover:!0,height:"inherit",src:e.image},null)]),o.prepend&&i("div",{class:"v-navigation-drawer__prepend"},[(Fe=o.prepend)==null?void 0:Fe.call(o)]),i("div",{class:"v-navigation-drawer__content"},[(Ue=o.default)==null?void 0:Ue.call(o)]),o.append&&i("div",{class:"v-navigation-drawer__append"},[(We=o.append)==null?void 0:We.call(o)])]}}),i(pa,{name:"fade-transition"},{default:()=>[O.value&&(A.value||g.value)&&!!e.scrim&&i("div",U({class:["v-navigation-drawer__scrim",E.backgroundColorClasses.value],style:[Q.value,E.backgroundColorStyles.value],onClick:()=>{C.value||(g.value=!1)}},k),null)]})])}),Re.then(()=>({isStuck:ge}))}}),Nn={components:{AuthForm:tn,OnlineUsers:on,CardLike:vn,VcardUser:xa,PageCounter:bn,DefaultPortalMenuList:Sn},mixins:[wa],setup(){const{name:e}=Vt(),a=_a(),n=Oa(),t=Ie(),o=x(!0),l=x(!0),s=x(!1),u=x(!1),c=x(!1),v=x(!1),f=ce.slice(0,-1),m=x([]),y=w({get:()=>!1});(()=>{t.cod2user||ut.get("api/navigation/screensaver/").then(_=>{console.log(_,"saver--")})})();const r=_=>_.slice(0,2).toUpperCase(),g=()=>{a.global.name.value=a.global.current.value.dark?"light":"dark"};n.loadlinks();const k=[{name:"Gitt",ico:"mdi-github",link:(()=>ce=="http://127.0.0.1:8000/"?"http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects":"http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22")()},{name:"Swagger",ico:"mdi-puzzle",link:"http://127.0.0.1:8000/swagger/"}],D=x([{name:"Новости",ico:"mdi-newspaper",path:"/news"},{name:"Структура",ico:"mdi-source-branch",submenu:[{name:"ОКиБ",path:"/okib"}]},{name:"Сотрудники",ico:"mdi-account-multiple-outline",submenu:[{name:"Справочник",link:"http://10.252.44.33/accounting6/members.php"}]},{name:"Календарь",ico:"mdi-calendar",path:"/ical"},{name:"Голосование",ico:"mdi-vote",path:"/vote"},{name:"Об инспекции",ico:"mdi-city",path:"/inspection"},{name:"О портале",ico:"mdi-information-variant",path:"/portal"}]),S=w(()=>new URL("/assets/FNS-logo-xs-e0e2f5b0.png",self.location).href),R=()=>{s.value=!1};return(()=>{pe.get("api/safety/gettypes/").then(_=>{if(_.data.forEach(b=>{b.path.startsWith("/")||(b.path="/"+b.path),b.path="/safety"+b.path}),_.data.length>0){let b={name:"Безопасность",ico:"mdi-security",submenu:_.data};D.value.splice(4,0,b)}})})(),{theme:a,mainmenuStore:n,accountStore:t,drawer:o,drawer_right:l,toggleTheme:g,navigations:D,imageSrc:S,LikeDialog:s,scrimg:m,oRasrab:k,rail:u,showTooltip:c,menuTruncated:r,alert:v,burl:f,name:e,closeinfo:R,baseURL:ce,getDevelopment:je,message:y}}},Hn=B("span",null,"F.A.Q.",-1),Fn=B("span",null," Сменить тему",-1),Un=B("span",null," Выход ",-1);function Wn(e,a,n,t,o,l){const s=X("vcard-user"),u=X("Card-like"),c=X("Auth-form"),v=X("default-portal-menu-list"),f=X("page-counter"),m=X("router-view"),y=X("alert-default"),h=X("Online-users");return $(),P(Cn,null,{default:d(()=>[i(En,{elevation:t.accountStore.cod2user?2:0,density:"compact",color:"app_bar",class:"pl-4"},{image:d(()=>[i(Be,{class:"bggrad"})]),append:d(()=>[t.accountStore.cod2user?($(),H(J,{key:0},[i(s,{author:t.accountStore.user},null,8,["author"]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white"},r,{dark:"",to:"/faq",icon:"mdi-comment-question-outline"}),null,16)]),default:d(()=>[Hn]),_:1}),i(gt,{modelValue:t.LikeDialog,"onUpdate:modelValue":a[2]||(a[2]=r=>t.LikeDialog=r),persistent:"",width:"800"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white"},r,{dark:"",icon:"mdi-thumb-up-outline"}),{default:d(()=>[i(W),i(F,{activator:"parent",location:"bottom"},{default:d(()=>[L("Обратная связь")]),_:1})]),_:2},1040)]),default:d(()=>[i(u,{LikeDialog:t.LikeDialog,onMenusClose:a[1]||(a[1]=r=>t.closeinfo())},null,8,["LikeDialog"])]),_:1},8,["modelValue"]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,{icon:"",onClick:t.toggleTheme},{default:d(()=>[i(W,U(r,{class:"mr-1",color:"lampa"}),{default:d(()=>[L(" mdi-lightbulb-outline ")]),_:2},1040)]),_:2},1032,["onClick"])]),default:d(()=>[Fn]),_:1}),ft(i(ue,{class:"",width:"50"},{default:d(()=>[L(M(t.name),1)]),_:1},512),[[mt,t.message]]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white",icon:"mdi-account-multiple-outline",onClick:a[3]||(a[3]=g=>t.drawer_right=!t.drawer_right)},r),null,16)]),default:d(()=>[B("span",null,M(t.drawer_right==!0?"Скрыть пользователей":"Показать пользователей"),1)]),_:1}),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white",icon:"mdi-logout",onClick:t.accountStore.logout},r),null,16,["onClick"])]),default:d(()=>[Un]),_:1})],64)):($(),P(K,{key:1,justify:"center"},{default:d(()=>[i(c,{onChallengealert:a[4]||(a[4]=r=>t.alert=!0)})]),_:1}))]),default:d(()=>[t.accountStore.cod2user?($(),P(W,{key:0,class:"px-3",size:"20",color:"black_and_white",icon:t.rail?"mdi-chevron-right":"mdi-chevron-left",onClick:a[0]||(a[0]=r=>t.rail=!t.rail)},null,8,["icon"])):N("",!0),t.accountStore.cod2user?($(),P(ue,{key:1,class:"bg-transparent py",color:"black_and_white",density:"compact","prepend-avatar":t.imageSrc,title:"Портал МИ ФНС России по ЦОД № 2",variant:"text",to:"/"},null,8,["prepend-avatar"])):N("",!0)]),_:1},8,["elevation"]),t.accountStore.cod2user?($(),P(it,{key:0,width:245,rail:t.rail,permanent:"",modelValue:t.drawer,"onUpdate:modelValue":a[5]||(a[5]=r=>t.drawer=r)},{default:d(()=>[i(K,{class:"my-0 h-100"},{default:d(()=>[i(Z,{class:"flex-column d-flex"},{default:d(()=>[i(K,null,{default:d(()=>[i(Z,null,{default:d(()=>[i(we,{nav:"",density:"compact"},{default:d(()=>[($(!0),H(J,null,le(t.navigations,(r,g)=>($(),H(J,null,[(r.path!="/portal"||t.accountStore.user.is_superuser)&&!("submenu"in r)?($(),P(ae,{key:r.key,title:r.name,value:r.name,href:r.link,disabled:r.path=="",to:r.path,target:r.link?"_blank":"",color:"navigation"},{prepend:d(()=>[i(W,{icon:r.ico},null,8,["icon"]),t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["title","value","href","disabled","to","target"])):N("",!0),r.path!="/portal"&&"submenu"in r?($(),P(Ca,{class:ba(t.rail?"railmenu":""),key:g,value:r.name},{activator:d(({props:p})=>[i(ae,U({ref_for:!0},p,{title:r.name,"prepend-icon":r.ico,color:"navigation"}),{default:d(()=>[t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1040,["title","prepend-icon"])]),default:d(()=>[($(!0),H(J,null,le(r.submenu,(p,k)=>($(),P(ae,{color:"navigation",href:p.link,key:k,value:p.name,title:t.rail?t.menuTruncated(p.name):p.name,to:p.path,target:p.link?"_blank":""},{default:d(()=>[t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(p.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["href","value","title","to","target"]))),128))]),_:2},1032,["class","value"])):N("",!0)],64))),256))]),_:1}),i(we,{nav:"",density:"compact"},{default:d(()=>[($(!0),H(J,null,le(t.mainmenuStore.portallinks,r=>($(),P(ae,{key:r.name,title:r.name,value:r.name,href:r.link,color:"app_bar",target:r.link?"_blank":""},{prepend:d(()=>[i(W,{icon:r.imagecode},null,8,["icon"]),t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["title","value","href","target"]))),128))]),_:1})]),_:1})]),_:1}),t.accountStore.user.is_staff?($(),P(K,{key:0,class:"flex-grow-0"},{default:d(()=>[i(Z,null,{default:d(()=>[i(v,{rail:t.rail},null,8,["rail"])]),_:1})]),_:1})):N("",!0),i(K,{"no-gutters":"",class:"flex-grow-0"},{default:d(()=>[i(Z,null,{default:d(()=>[i(f,{rail:t.rail},null,8,["rail"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["rail","modelValue"])):N("",!0),t.accountStore.cod2user?($(),P(ot,{key:1,class:"d-flex bg-main_theme"},{default:d(()=>[i(m),i(y)]),_:1})):($(),P(ot,{key:2,class:"d-flex align-center text-h3 bg-teal-lighten-2"},{default:d(()=>[i(ue,{class:"h-100 w-100 d-flex justify-center rounded-0 flex-column",image:`${t.burl}${t.scrimg}`},{default:d(()=>[i(Me,{class:"justify-center bgCard h-100 ma-3 d-flex flex-column"},{default:d(()=>[i(K,{class:"bgText flex-grow-0"},{default:d(()=>[i(Z,{class:"text-center textcolor font-weight-black text-h3 pb-0"},{default:d(()=>[L(" Добро пожаловать на портал МИ ФНС России по ЦОД № 2 ")]),_:1})]),_:1}),i(K,{class:"bgText flex-grow-0"},{default:d(()=>[i(Z,{class:"text-subtitle-1 text-center textcolor pt-0"},{default:d(()=>[L(" Авторизуйтесь для получения доступа к контенту портала ")]),_:1})]),_:1})]),_:1})]),_:1},8,["image"]),i(y)]),_:1})),t.accountStore.cod2user?($(),P(it,{key:3,modelValue:t.drawer_right,"onUpdate:modelValue":a[6]||(a[6]=r=>t.drawer_right=r),rail:"",permanent:"",location:"right",onClick:a[7]||(a[7]=r=>t.rail=!1)},{default:d(()=>[i(h)]),_:1},8,["modelValue"])):N("",!0)]),_:1})}const or=se(Nn,[["render",Wn]]);export{or as default}; diff --git a/src/front/dist/assets/DefaultPortal-4edddc61.js b/src/front/dist/assets/DefaultPortal-4edddc61.js new file mode 100644 index 000000000..6c431cd91 --- /dev/null +++ b/src/front/dist/assets/DefaultPortal-4edddc61.js @@ -0,0 +1 @@ +import{d as jt,r as x,c as ut,a as Lt,o as Dt,w as z,i as Te,b as $e,e as ke,f as w,u as V,h as It,j as Mt,k as qe,p as Ye,n as Ae,_ as se,l as Ie,m as ct,q as fe,s as $,t as P,v as d,x as i,V as W,y as L,z as U,A as Y,B as dt,C as Me,D as K,E as Z,F as vt,G as ft,H as mt,I as Bt,J as zt,K as ue,L as gt,M as B,N as Nt,O as Ht,P as Ft,Q as X,R as H,S as J,T as le,U as pe,W as Ut,X as Be,Y as Wt,Z as oe,$ as M,a0 as N,a1 as qt,a2 as Yt,a3 as ae,a4 as F,a5 as ce,a6 as je,a7 as me,a8 as ze,a9 as Gt,aa as ht,ab as Ve,ac as pt,ad as Xt,ae as yt,af as Se,ag as Kt,ah as q,ai as Zt,aj as wt,ak as _t,al as de,am as bt,an as ye,ao as $t,ap as Jt,aq as kt,ar as Qt,as as ea,at as ta,au as aa,av as na,aw as ra,ax as oa,ay as la,az as sa,aA as ia,aB as ua,aC as Ge,aD as ca,aE as Vt,aF as da,aG as va,aH as fa,aI as ma,aJ as ga,aK as ha,aL as pa,aM as ya,aN as wa,aO as _a,aP as ba}from"./index-f3f24177.js";import{V as St}from"./VContainer-1fb03ac7.js";import{V as Xe}from"./VTextField-2c3c89ba.js";import{V as xt}from"./VSpacer-9ba25539.js";import{V as $a}from"./VAlert-f6b51d8d.js";import{F as ka}from"./feedstar-like-d1c3d07c.js";import{V as Va}from"./VTextarea-d04410cf.js";import{V as Sa}from"./vcardUser-6b6586f8.js";import{V as we,a as xa}from"./VList-983e49dd.js";import{m as Ca,V as Ke}from"./VToolbar-b8510e35.js";import{u as Ne}from"./ssrBoot-4527a6ac.js";/* empty css */import"./VField-ac1e4507.js";import"./VInput-3de7b4b2.js";const Oa=jt("MainmenuStore",()=>{const e=x([]);return{portallinks:e,loadlinks:async()=>{const n=await ut.get("api/navigation/links/");e.value=n.data}}});function Ze(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function ee(e){for(var a=1;a1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(e).reduce((n,t)=>(a.includes(t)||(n[t]=V(e[t])),n),{})}function _e(e){return typeof e=="function"}function Pa(e){return It(e)||Mt(e)}function Ct(e,a,n){let t=e;const o=a.split(".");for(let l=0;le.some(t=>Ct(a,t,{[n]:!1})[n]))}function Qe(e,a,n){return w(()=>e.reduce((t,o)=>{const l=Ct(a,o,{[n]:!1})[n]||[];return t.concat(l)},[]))}function Ot(e,a,n,t){return e.call(t,V(a),V(n),t)}function Rt(e){return e.$valid!==void 0?!e.$valid:!e}function Ea(e,a,n,t,o,l,s){let{$lazy:u,$rewardEarly:c}=o,v=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],f=arguments.length>8?arguments[8]:void 0,m=arguments.length>9?arguments[9]:void 0,y=arguments.length>10?arguments[10]:void 0;const h=x(!!t.value),r=x(0);n.value=!1;const g=z([a,t].concat(v,y),()=>{if(u&&!t.value||c&&!m.value&&!n.value)return;let p;try{p=Ot(e,a,f,s)}catch(k){p=Promise.reject(k)}r.value++,n.value=!!r.value,h.value=!1,Promise.resolve(p).then(k=>{r.value--,n.value=!!r.value,l.value=k,h.value=Rt(k)}).catch(k=>{r.value--,n.value=!!r.value,l.value=k,h.value=!0})},{immediate:!0,deep:typeof a=="object"});return{$invalid:h,$unwatch:g}}function Ta(e,a,n,t,o,l,s,u){let{$lazy:c,$rewardEarly:v}=t;const f=()=>({}),m=w(()=>{if(c&&!n.value||v&&!u.value)return!1;let y=!0;try{const h=Ot(e,a,s,l);o.value=h,y=Rt(h)}catch(h){o.value=h}return y});return{$unwatch:f,$invalid:m}}function Aa(e,a,n,t,o,l,s,u,c,v,f){const m=x(!1),y=e.$params||{},h=x(null);let r,g;e.$async?{$invalid:r,$unwatch:g}=Ea(e.$validator,a,m,n,t,h,o,e.$watchTargets,c,v,f):{$invalid:r,$unwatch:g}=Ta(e.$validator,a,n,t,h,o,c,v);const p=e.$message;return{$message:_e(p)?w(()=>p(Je({$pending:m,$invalid:r,$params:Je(y),$model:a,$response:h,$validator:l,$propertyPath:u,$property:s}))):p||"",$params:y,$pending:m,$invalid:r,$response:h,$unwatch:g}}function ja(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const a=V(e),n=Object.keys(a),t={},o={},l={};let s=null;return n.forEach(u=>{const c=a[u];switch(!0){case _e(c.$validator):t[u]=c;break;case _e(c):t[u]={$validator:c};break;case u==="$validationGroups":s=c;break;case u.startsWith("$"):l[u]=c;break;default:o[u]=c}}),{rules:t,nestedValidators:o,config:l,validationGroups:s}}const La="__root";function Da(e,a,n,t,o,l,s,u,c){const v=Object.keys(e),f=t.get(o,e),m=x(!1),y=x(!1),h=x(0);if(f){if(!f.$partial)return f;f.$unwatch(),m.value=f.$dirty.value}const r={$dirty:m,$path:o,$touch:()=>{m.value||(m.value=!0)},$reset:()=>{m.value&&(m.value=!1)},$commit:()=>{}};return v.length?(v.forEach(g=>{r[g]=Aa(e[g],a,r.$dirty,l,s,g,n,o,c,y,h)}),r.$externalResults=w(()=>u.value?[].concat(u.value).map((g,p)=>({$propertyPath:o,$property:n,$validator:"$externalResults",$uid:`${o}-externalResult-${p}`,$message:g,$params:{},$response:null,$pending:!1})):[]),r.$invalid=w(()=>{const g=v.some(p=>V(r[p].$invalid));return y.value=g,!!r.$externalResults.value.length||g}),r.$pending=w(()=>v.some(g=>V(r[g].$pending))),r.$error=w(()=>r.$dirty.value?r.$pending.value||r.$invalid.value:!1),r.$silentErrors=w(()=>v.filter(g=>V(r[g].$invalid)).map(g=>{const p=r[g];return $e({$propertyPath:o,$property:n,$validator:g,$uid:`${o}-${g}`,$message:p.$message,$params:p.$params,$response:p.$response,$pending:p.$pending})}).concat(r.$externalResults.value)),r.$errors=w(()=>r.$dirty.value?r.$silentErrors.value:[]),r.$unwatch=()=>v.forEach(g=>{r[g].$unwatch()}),r.$commit=()=>{y.value=!0,h.value=Date.now()},t.set(o,e,r),r):(f&&t.set(o,e,r),r)}function Ia(e,a,n,t,o,l,s){const u=Object.keys(e);return u.length?u.reduce((c,v)=>(c[v]=Le({validations:e[v],state:a,key:v,parentKey:n,resultsCache:t,globalConfig:o,instance:l,externalResults:s}),c),{}):{}}function Ma(e,a,n){const t=w(()=>[a,n].filter(r=>r).reduce((r,g)=>r.concat(Object.values(V(g))),[])),o=w({get(){return e.$dirty.value||(t.value.length?t.value.every(r=>r.$dirty):!1)},set(r){e.$dirty.value=r}}),l=w(()=>{const r=V(e.$silentErrors)||[],g=t.value.filter(p=>(V(p).$silentErrors||[]).length).reduce((p,k)=>p.concat(...k.$silentErrors),[]);return r.concat(g)}),s=w(()=>{const r=V(e.$errors)||[],g=t.value.filter(p=>(V(p).$errors||[]).length).reduce((p,k)=>p.concat(...k.$errors),[]);return r.concat(g)}),u=w(()=>t.value.some(r=>r.$invalid)||V(e.$invalid)||!1),c=w(()=>t.value.some(r=>V(r.$pending))||V(e.$pending)||!1),v=w(()=>t.value.some(r=>r.$dirty)||t.value.some(r=>r.$anyDirty)||o.value),f=w(()=>o.value?c.value||u.value:!1),m=()=>{e.$touch(),t.value.forEach(r=>{r.$touch()})},y=()=>{e.$commit(),t.value.forEach(r=>{r.$commit()})},h=()=>{e.$reset(),t.value.forEach(r=>{r.$reset()})};return t.value.length&&t.value.every(r=>r.$dirty)&&m(),{$dirty:o,$errors:s,$invalid:u,$anyDirty:v,$error:f,$pending:c,$touch:m,$reset:h,$silentErrors:l,$commit:y}}function Le(e){let{validations:a,state:n,key:t,parentKey:o,childResults:l,resultsCache:s,globalConfig:u={},instance:c,externalResults:v}=e;const f=o?`${o}.${t}`:t,{rules:m,nestedValidators:y,config:h,validationGroups:r}=ja(a),g=ee(ee({},u),h),p=t?w(()=>{const E=V(n);return E?V(E[t]):void 0}):n,k=ee({},V(v)||{}),D=w(()=>{const E=V(v);return t?E?V(E[t]):void 0:E}),S=Da(m,p,t,s,f,g,c,D,n),R=Ia(y,p,f,s,g,c,D),I={};r&&Object.entries(r).forEach(E=>{let[Q,T]=E;I[Q]={$invalid:Ee(T,R,"$invalid"),$error:Ee(T,R,"$error"),$pending:Ee(T,R,"$pending"),$errors:Qe(T,R,"$errors"),$silentErrors:Qe(T,R,"$silentErrors")}});const{$dirty:_,$errors:b,$invalid:C,$anyDirty:O,$error:j,$pending:A,$touch:G,$reset:ne,$silentErrors:Ce,$commit:ie}=Ma(S,R,l),Oe=t?w({get:()=>V(p),set:E=>{_.value=!0;const Q=V(n),T=V(v);T&&(T[t]=k[t]),Te(Q[t])?Q[t].value=E:Q[t]=E}}):null;t&&g.$autoDirty&&z(p,()=>{_.value||G();const E=V(v);E&&(E[t]=k[t])},{flush:"sync"});async function Re(){return G(),g.$rewardEarly&&(ie(),await Ae()),await Ae(),new Promise(E=>{if(!A.value)return E(!C.value);const Q=z(A,()=>{E(!C.value),Q()})})}function ge(E){return(l.value||{})[E]}function Pe(){Te(v)?v.value=k:Object.keys(k).length===0?Object.keys(v).forEach(E=>{delete v[E]}):Object.assign(v,k)}return $e(ee(ee(ee({},S),{},{$model:Oe,$dirty:_,$error:j,$errors:b,$invalid:C,$anyDirty:O,$pending:A,$touch:G,$reset:ne,$path:f||La,$silentErrors:Ce,$validate:Re,$commit:ie},l&&{$getResultsForChild:ge,$clearExternalResults:Pe,$validationGroups:I}),R))}class Ba{constructor(){this.storage=new Map}set(a,n,t){this.storage.set(a,{rules:n,result:t})}checkRulesValidity(a,n,t){const o=Object.keys(t),l=Object.keys(n);return l.length!==o.length||!l.every(u=>o.includes(u))?!1:l.every(u=>n[u].$params?Object.keys(n[u].$params).every(c=>V(t[u].$params[c])===V(n[u].$params[c])):!0)}get(a,n){const t=this.storage.get(a);if(!t)return;const{rules:o,result:l}=t,s=this.checkRulesValidity(a,n,o),u=l.$unwatch?l.$unwatch:()=>({});return s?l:{$dirty:l.$dirty,$partial:!0,$unwatch:u}}}const he={COLLECT_ALL:!0,COLLECT_NONE:!1},et=Symbol("vuelidate#injectChildResults"),tt=Symbol("vuelidate#removeChildResults");function za(e){let{$scope:a,instance:n}=e;const t={},o=x([]),l=w(()=>o.value.reduce((f,m)=>(f[m]=V(t[m]),f),{}));function s(f,m){let{$registerAs:y,$scope:h,$stopPropagation:r}=m;r||a===he.COLLECT_NONE||h===he.COLLECT_NONE||a!==he.COLLECT_ALL&&a!==h||(t[y]=f,o.value.push(y))}n.__vuelidateInjectInstances=[].concat(n.__vuelidateInjectInstances||[],s);function u(f){o.value=o.value.filter(m=>m!==f),delete t[f]}n.__vuelidateRemoveInstances=[].concat(n.__vuelidateRemoveInstances||[],u);const c=qe(et,[]);Ye(et,n.__vuelidateInjectInstances);const v=qe(tt,[]);return Ye(tt,n.__vuelidateRemoveInstances),{childResults:l,sendValidationResultsToParent:c,removeValidationResultsFromParent:v}}function Pt(e){return new Proxy(e,{get(a,n){return typeof a[n]=="object"?Pt(a[n]):w(()=>a[n])}})}let at=0;function Na(e,a){var n;let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(t=e,e=void 0,a=void 0);let{$registerAs:o,$scope:l=he.COLLECT_ALL,$stopPropagation:s,$externalResults:u,currentVueInstance:c}=t;const v=c||((n=Lt())===null||n===void 0?void 0:n.proxy),f=v?v.$options:{};o||(at+=1,o=`_vuelidate_${at}`);const m=x({}),y=new Ba,{childResults:h,sendValidationResultsToParent:r,removeValidationResultsFromParent:g}=v?za({$scope:l,instance:v}):{childResults:x({})};if(!e&&f.validations){const p=f.validations;a=x({}),Dt(()=>{a.value=v,z(()=>_e(p)?p.call(a.value,new Pt(a.value)):p,k=>{m.value=Le({validations:k,state:a,childResults:h,resultsCache:y,globalConfig:t,instance:v,externalResults:u||v.vuelidateExternalResults})},{immediate:!0})}),t=f.validationsConfig||t}else{const p=Te(e)||Pa(e)?e:$e(e||{});z(p,k=>{m.value=Le({validations:k,state:a,childResults:h,resultsCache:y,globalConfig:t,instance:v??{},externalResults:u})},{immediate:!0})}return v&&(r.forEach(p=>p(m,{$registerAs:o,$scope:l,$stopPropagation:s})),ke(()=>g.forEach(p=>p(o)))),w(()=>ee(ee({},V(m.value)),h.value))}function nt(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function ve(e){for(var a=1;a1&&arguments[1]!==void 0?arguments[1]:[];const n=xe(e);return ve(ve({},n),{},{$async:!0,$watchTargets:a})}function qa(e){return{$validator(a){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o{const c=Object.entries(s).reduce((v,f)=>{let[m,y]=f;const h=e[m]||{},r=Object.entries(h).reduce((g,p)=>{let[k,D]=p;const R=Tt(D).call(this,y,s,u,...t),I=Et(R);if(g.$data[k]=R,g.$data.$invalid=!I||!!g.$data.$invalid,g.$data.$error=g.$data.$invalid,!I){let _=D.$message||"";const b=D.$params||{};typeof _=="function"&&(_=_({$pending:!1,$invalid:!I,$params:b,$model:y,$response:R})),g.$errors.push({$property:m,$message:_,$params:b,$response:R,$model:y,$pending:!1,$validator:k})}return{$valid:g.$valid&&I,$data:g.$data,$errors:g.$errors}},{$valid:!0,$data:{},$errors:[]});return v.$data[m]=r.$data,v.$errors[m]=r.$errors,{$valid:v.$valid&&r.$valid,$data:v.$data,$errors:v.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:l.$valid&&c.$valid,$data:l.$data.concat(c.$data),$errors:l.$errors.concat(c.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:a=>{let{$response:n}=a;return n?n.$errors.map(t=>Object.values(t).map(o=>o.map(l=>l.$message)).reduce((o,l)=>o.concat(l),[])):[]}}}const He=e=>{if(e=V(e),Array.isArray(e))return!!e.length;if(e==null)return!1;if(e===!1)return!0;if(e instanceof Date)return!isNaN(e.getTime());if(typeof e=="object"){for(let a in e)return!0;return!1}return!!String(e).length},Ya=e=>(e=V(e),Array.isArray(e)?e.length:typeof e=="object"?Object.keys(e).length:String(e).length);function te(){for(var e=arguments.length,a=new Array(e),n=0;n(t=V(t),!He(t)||a.every(o=>(o.lastIndex=0,o.test(t))))}var At=Object.freeze({__proto__:null,forEach:qa,len:Ya,normalizeValidatorObject:xe,regex:te,req:He,unwrap:V,unwrapNormalizedValidator:Tt,unwrapValidatorResponse:Et,withAsync:Wa,withMessage:Ua,withParams:Fa});te(/^[a-zA-Z]*$/);te(/^[a-zA-Z0-9]*$/);te(/^\d*(\.\d+)?$/);const Ga=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;te(Ga);function Xa(e){return typeof e=="string"&&(e=e.trim()),He(e)}var Ka={$validator:Xa,$message:"Value is required",$params:{type:"required"}};const Za=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[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]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;te(Za);te(/(^[0-9]*$)|(^-[0-9]+$)/);te(/^[-]?\d*(\.\d+)?$/);const rt=At.withMessage("Обязательное поле",Ka),Ja={setup(e,a){const n=Ie(),t=ct(),o=x(!1),l=x(""),s=x(!1),u=x(!1),c=$e({username:"9966-00-",password:""}),v=w(()=>({username:{req:rt,latin:At.withMessage(()=>'Логин имееет вид "0000-00-000"',h=>/(\d{4,4}[-]\d{2,2}[-]\d{3,3})+$/.test(h.toString()))},password:{req:rt}})),f=Na(v,c),m=h=>f.value[h].$error?f.value[h].$errors[0].$message:"",y=async()=>{if(f.value.$error)console.log(!0);else try{await n.logging(c)}catch{t.loading=!1,s.value=!0,l.value="Ошибка авторизации"}};return fe(()=>{f.value.$validate()}),{accountStore:n,AppStore:t,menuAuthDialog:o,anon:c,v$:f,logging:y,errorer:m,alert:s,err:l,eyeshow:u}}},Qa=B("span",{class:"text-h5"},"Вход в портал",-1);function en(e,a,n,t,o,l){return $(),P(gt,{modelValue:t.menuAuthDialog,"onUpdate:modelValue":a[6]||(a[6]=s=>t.menuAuthDialog=s),persistent:"",width:"400"},{activator:d(({props:s})=>[i(Y,U(s,{"append-icon":"mdi-login",color:"black_and_white"}),{prepend:d(()=>[i(W,{color:"black_and_white"})]),append:d(()=>[i(W,{color:"black_and_white"})]),default:d(()=>[L(" Войти ")]),_:2},1040)]),default:d(()=>[i(ue,{onKeyup:zt(t.logging,["enter"])},{default:d(()=>[i(dt,null,{default:d(()=>[Qa]),_:1}),i(Me,null,{default:d(()=>[i(St,null,{default:d(()=>[i(K,null,{default:d(()=>[i(Z,{cols:"12",class:"py-0"},{default:d(()=>[i(Xe,{modelValue:t.anon.username,"onUpdate:modelValue":a[0]||(a[0]=s=>t.anon.username=s),label:"Логин",variant:"underlined","error-messages":t.errorer("username")},null,8,["modelValue","error-messages"])]),_:1}),i(Z,{cols:"12",class:"py-0"},{default:d(()=>[i(Xe,{type:t.eyeshow?"text":"password",modelValue:t.anon.password,"onUpdate:modelValue":a[2]||(a[2]=s=>t.anon.password=s),label:"Пароль",variant:"underlined","error-messages":t.errorer("password"),"onClick:appendInner":a[3]||(a[3]=s=>t.eyeshow=!t.eyeshow)},{"append-inner":d(()=>[i(W,{size:"x-small",icon:t.eyeshow?"mdi-eye":"mdi-eye-off",onClick:a[1]||(a[1]=s=>t.eyeshow=!t.eyeshow)},null,8,["icon"])]),_:1},8,["type","modelValue","error-messages"])]),_:1})]),_:1})]),_:1})]),_:1}),i(vt,null,{default:d(()=>[i(xt),i(Y,{color:"modal_btn",variant:"text",onClick:a[4]||(a[4]=s=>t.menuAuthDialog=!1)},{default:d(()=>[L(" Отмена ")]),_:1}),i(Y,{color:"modal_btn",variant:"text",onClick:t.logging},{default:d(()=>[L(" Войти ")]),_:1},8,["onClick"])]),_:1}),ft(i(Bt,{location:"bottom",absolute:"",indeterminate:""},null,512),[[mt,t.AppStore.loading&&!t.alert]])]),_:1},8,["onKeyup"]),i($a,{width:"400",position:"fixed",class:"bottom-alertauth bgerroralert",type:"error",density:"compact",title:"Ошибка авторизации",text:e.info,modelValue:t.alert,"onUpdate:modelValue":a[5]||(a[5]=s=>t.alert=s),closable:""},{prepend:d(()=>[i(W,{icon:"mdi-alert-outline",class:"pt-1"})]),_:1},8,["text","modelValue"])]),_:1},8,["modelValue"])}const tn=se(Ja,[["render",en]]),an={setup(){const e=x({}),a=x(!1),n={onliner:function(u){let c=new Set(u),v=Array.from(c);v.splice(v.findIndex(f=>f==t.user.login),1),o.value=v}},t=Ie();let o=x([]);const l=new WebSocket(Nt+"ws/watcher/?token="+localStorage.access),s=u=>{a.value=!0,pe.get(`api/accounts/getuser/?userlogin=${u}`).then(c=>{e.value={department:c.data.department,fio:c.data.fio,post:c.data.post,email:c.data.email,tel:c.data.tel,room:c.data.room,login:c.data.login}})};return l.onmessage=u=>{let c=JSON.parse(u.data);n[c.message.action](c.message.data)},z(()=>t.cod2user,function(){t.cod2user.value||l.close()}),{author:e,open:a,onlineuser:o,checkremote:Ht,spravURL:Ft,whatuser:s,accountStore:t}}},nn={class:"align-center d-flex flex-column py-1"};function rn(e,a,n,t,o,l){const s=X("info-user-card");return $(),H("div",nn,[($(!0),H(J,null,le(t.onlineuser,u=>($(),P(Y,{variant:"text",key:u,height:"50"},{default:d(()=>[i(Ut,{size:"36px"},{default:d(()=>[i(Be,{src:t.checkremote(`${t.spravURL}${u}.jpg`),onClick:c=>t.whatuser(u)},null,8,["src","onClick"])]),_:2},1024)]),_:2},1024))),128)),i(s,{author:t.author,opendialog:t.open,"onUpdate:opendialog":a[0]||(a[0]=u=>t.open=u)},null,8,["author","opendialog"])])}const on=se(an,[["render",rn]]);const ln={components:{FeedstarLike:ka},props:{LikeDialog:{type:Boolean,default:!1}},setup(e,{emit:a}){const n=Wt().alert,t=x({nowcomment:{comment:""},nowrating:[]});function o(){pe.get("api/feedback/feedbackdata/").then(f=>{if(t.value=f.data,t.value.nowrating.length==0)for(let m of t.value.basecrit)t.value.nowrating.push({rating:m.rating,crit:m.id,id:null});t.value.nowcomment===null&&(t.value.nowcomment={comment:"",id:null})})}fe(()=>{o()});const l=w(()=>{const m=t.value.nowrating.reduce((h,r)=>h+r.rating,0)/t.value.nowrating.length;return Number.isInteger(m)?m:m.toFixed(1)});function s(){let f="";return l.value>0&&l.value<=3?f="УПС-С! Мы обязательно все исправим":l.value>2&&l.value<=4?f="Спасибо за обратную связь, мы обратим на это внимание":l.value>4&&l.value<5?f="Класс, будем стараться до 5":f="Спасибо за отзыв и высокую оценку ^__^",f}function u(){a("menusClose")}function c(){pe.post("api/feedback/feedbackdata/",{nowrating:t.value.nowrating,nowcomment:t.value.nowcomment}).then(f=>{}),n.alert=!0,v(),u()}const v=()=>{t.value.nowcomment.id==null?(n.text="Оценка отправлена, спасибо за участие",n.ico="mdi-redo-variant",n.color="green-darken-4"):(n.text="Оценка обновлена",n.ico="mdi-refresh",n.color="light-blue-darken-4")};return{feedbackdata:t,average:l,menusCloses:u,myLabel:s,feedSend:c,feedalert:n}}},sn=B("span",{class:"text-h5"},"Обратная связь",-1),un={key:0,class:"pl-5"},cn={class:"font-weight-black"};function dn(e,a,n,t,o,l){const s=X("feedstar-like");return $(),P(ue,{class:"pt-2"},{default:d(()=>[i(dt,null,{default:d(()=>[sn]),_:1}),i(Me,{class:"px-2 py-0"},{default:d(()=>[i(St,null,{default:d(()=>[i(K,null,{default:d(()=>[i(Z,{class:"flex-grow-0 py-0 text-no-wrap align-self-center text-button"},{default:d(()=>[L(" Оцените сайт ")]),_:1}),i(oe,{class:"pb-3"})]),_:1}),i(s,{rating:t.feedbackdata,"onUpdate:rating":a[0]||(a[0]=u=>t.feedbackdata.nowrating=u)},null,8,["rating"]),i(K,{class:"mt-6"},{default:d(()=>[i(Z,{class:"pa-0 px-3"},{default:d(()=>[i(Va,{label:"Ваши комментарии сделают портал лучше","hide-details":"",variant:"outlined",rows:"5","row-height":"15",modelValue:t.feedbackdata.nowcomment.comment,"onUpdate:modelValue":a[1]||(a[1]=u=>t.feedbackdata.nowcomment.comment=u)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),i(vt,{class:"pt-0"},{default:d(()=>[t.average<5||t.feedbackdata.nowcomment.id!=null?($(),H("small",un,[L(" Вы оценили сайт на "),B("span",cn,M(t.average),1),L(" "+M(t.myLabel()),1)])):N("",!0),i(xt),i(Y,{color:"modal_btn",variant:"text",text:"Закрыть",onClick:t.menusCloses},null,8,["onClick"]),i(Y,{color:"modal_btn",variant:"text",text:t.feedbackdata.nowcomment.id==null?"Отправить":"Обновить",onClick:t.feedSend},null,8,["text","onClick"])]),_:1})]),_:1})}const vn=se(ln,[["render",dn]]),fn={name:"PageCounter",props:{rail:{type:Boolean,default:!1}},setup(){const e=qt(),a=ct(),n=x(!1);return{router:e,appStore:a,showTooltip:n,formatComa:Yt}}},mn={class:"text-caption"},gn=B("br",null,null,-1),hn=B("br",null,null,-1),pn={class:"cursor-default"},yn={class:"cursor-default"},wn={class:"cursor-default"};function _n(e,a,n,t,o,l){return $(),P(we,{class:"pa-0"},{default:d(()=>[n.rail?($(),P(ae,{key:1,class:"align-center"},{default:d(()=>[i(F,{modelValue:t.showTooltip,"onUpdate:modelValue":a[0]||(a[0]=s=>t.showTooltip=s),location:"top"},{activator:d(({props:s})=>[i(W,U(s,{color:"grey"}),{default:d(()=>[L(" mdi-account-eye ")]),_:2},1040)]),default:d(()=>[B("p",null,"Посещений всего: "+M(t.appStore.countvisitor.totalvisit),1),i(oe),B("p",null,"Посещений сегодня: "+M(t.appStore.countvisitor.visittoday),1),i(oe),B("p",null,"Из них уникальных: "+M(t.appStore.countvisitor.uniqtoday),1)]),_:1},8,["modelValue"])]),_:1})):($(),P(ae,{key:0,class:"text-caption font-weight-bold text-truncate"},{default:d(()=>[i(F,null,{activator:d(({props:s})=>[i(W,U({icon:"mdi-information",color:"cyan-darken-3",size:"12",class:"cursor-help"},s),null,16)]),default:d(()=>[B("span",mn,[L(" Информация о странице: "),gn,L(" "+M(t.router.currentRoute.value.meta.title)+" ",1),hn,L(" с "+M(t.formatComa(t.appStore.countvisitor.visitdate)),1)])]),_:1}),B("p",pn,"Посещений всего: "+M(t.appStore.countvisitor.totalvisit),1),i(oe),B("p",yn,"Посещений сегодня: "+M(t.appStore.countvisitor.visittoday),1),i(oe),B("p",wn,"Из них уникальных: "+M(t.appStore.countvisitor.uniqtoday),1),i(oe)]),_:1}))]),_:1})}const bn=se(fn,[["render",_n]]),$n={props:{rail:{type:Boolean,default:!1}},setup(){const e=()=>ce=="http://127.0.0.1:8000/"?"http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects":"http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22";return{aMenuItem:{prom:[{name:"Панель администратора",ico:"mdi-wrench",link:ce+"admin"}],my:[{name:"Gitt",ico:"mdi-github",link:e()},{name:"Swagger",ico:"mdi-puzzle",link:"http://127.0.0.1:8000/swagger/"}]},getDevelopment:je,showProm:t=>{let o=!0;return t=="my"&&je()==!1&&(o=!1),o}}}},kn={key:0};function Vn(e,a,n,t,o,l){return $(),H("div",null,[i(we,{nav:"",density:"compact",class:"text-blue-grey-lighten-1"},{default:d(()=>[($(!0),H(J,null,le(t.aMenuItem,(s,u)=>($(),H("div",{key:u},[t.showProm(u)?($(),H("div",kn,[($(!0),H(J,null,le(s,c=>($(),P(ae,{key:c,title:c.name,value:c.name,href:c.link,target:c.link?"_blank":"",slim:""},{prepend:d(()=>[i(W,{icon:c.ico,size:"x_small"},null,8,["icon"]),n.rail?($(),P(F,{key:0,activator:"parent",location:"top"})):N("",!0)]),_:2},1032,["title","value","href","target"]))),128))])):N("",!0)]))),128))]),_:1})])}const Sn=se($n,[["render",Vn]]);const xn=me({...ze(),...Gt({fullHeight:!0}),...ht()},"VApp"),Cn=Ve()({name:"VApp",props:xn(),setup(e,a){let{slots:n}=a;const t=pt(e),{layoutClasses:o,getLayoutItem:l,items:s,layoutRef:u}=Xt(e),{rtlClasses:c}=yt();return Se(()=>i("div",{ref:u,class:["v-application",t.themeClasses.value,o.value,c.value,e.class],style:[e.style]},[i("div",{class:"v-application__wrap"},[i(Kt,null,{default:()=>{var v;return[i(J,null,[(v=n.default)==null?void 0:v.call(n)])]}})])])),{getLayoutItem:l,items:s,theme:t}}});const On=me({scrollTarget:{type:String},scrollThreshold:{type:[String,Number],default:300}},"scroll");function Rn(e){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{canScroll:n}=a;let t=0,o=0;const l=x(null),s=q(0),u=q(0),c=q(0),v=q(!1),f=q(!1),m=w(()=>Number(e.scrollThreshold)),y=w(()=>Zt((m.value-s.value)/m.value||0)),h=()=>{const r=l.value;if(!r||n&&!n.value)return;t=s.value,s.value="window"in r?r.pageYOffset:r.scrollTop;const g=r instanceof Window?document.documentElement.scrollHeight:r.scrollHeight;if(o!==g){o=g;return}f.value=s.value{u.value=u.value||s.value}),z(v,()=>{u.value=0}),fe(()=>{z(()=>e.scrollTarget,r=>{var p;const g=r?document.querySelector(r):window;g&&g!==l.value&&((p=l.value)==null||p.removeEventListener("scroll",h),l.value=g,l.value.addEventListener("scroll",h,{passive:!0}))},{immediate:!0})}),ke(()=>{var r;(r=l.value)==null||r.removeEventListener("scroll",h)}),n&&z(n,h,{immediate:!0}),{scrollThreshold:m,currentScroll:s,currentThreshold:c,isScrollActive:v,scrollRatio:y,isScrollingUp:f,savedScroll:u}}const Pn=me({scrollBehavior:String,modelValue:{type:Boolean,default:!0},location:{type:String,default:"top",validator:e=>["top","bottom"].includes(e)},...Ca(),...wt(),...On(),height:{type:[Number,String],default:64}},"VAppBar"),En=Ve()({name:"VAppBar",props:Pn(),emits:{"update:modelValue":e=>!0},setup(e,a){let{slots:n}=a;const t=x(),o=_t(e,"modelValue"),l=w(()=>{var R;const S=new Set(((R=e.scrollBehavior)==null?void 0:R.split(" "))??[]);return{hide:S.has("hide"),fullyHide:S.has("fully-hide"),inverted:S.has("inverted"),collapse:S.has("collapse"),elevate:S.has("elevate"),fadeImage:S.has("fade-image")}}),s=w(()=>{const S=l.value;return S.hide||S.fullyHide||S.inverted||S.collapse||S.elevate||S.fadeImage||!o.value}),{currentScroll:u,scrollThreshold:c,isScrollingUp:v,scrollRatio:f}=Rn(e,{canScroll:s}),m=w(()=>l.value.hide||l.value.fullyHide),y=w(()=>e.collapse||l.value.collapse&&(l.value.inverted?f.value>0:f.value===0)),h=w(()=>e.flat||l.value.fullyHide&&!o.value||l.value.elevate&&(l.value.inverted?u.value>0:u.value===0)),r=w(()=>l.value.fadeImage?l.value.inverted?1-f.value:f.value:void 0),g=w(()=>{var I,_;const S=Number(((I=t.value)==null?void 0:I.contentHeight)??e.height),R=Number(((_=t.value)==null?void 0:_.extensionHeight)??0);return m.value?u.value!!e.scrollBehavior),()=>{$t(()=>{m.value?l.value.inverted?o.value=u.value>c.value:o.value=v.value||u.valueparseInt(e.order,10)),position:ye(e,"location"),layoutSize:g,elementSize:q(void 0),active:o,absolute:ye(e,"absolute")});return Se(()=>{const S=Ke.filterProps(e);return i(Ke,U({ref:t,class:["v-app-bar",{"v-app-bar--bottom":e.location==="bottom"},e.class],style:[{...k.value,"--v-toolbar-image-opacity":r.value,height:void 0,...p.value},e.style]},S,{collapse:y.value,flat:h.value}),n)}),D}});const Tn=me({scrollable:Boolean,...ze(),...Jt(),...kt({tag:"main"})},"VMain"),ot=Ve()({name:"VMain",props:Tn(),setup(e,a){let{slots:n}=a;const{dimensionStyles:t}=Qt(e),{mainStyles:o,layoutIsReady:l}=ea(),{ssrBootStyles:s}=Ne();return Se(()=>i(e.tag,{class:["v-main",{"v-main--scrollable":e.scrollable},e.class],style:[o.value,s.value,t.value,e.style]},{default:()=>{var u,c;return[e.scrollable?i("div",{class:"v-main__scroller"},[(u=n.default)==null?void 0:u.call(n)]):(c=n.default)==null?void 0:c.call(n)]}})),l}});function An(e){let{rootEl:a,isSticky:n,layoutItemStyles:t}=e;const o=q(!1),l=q(0),s=w(()=>{const v=typeof o.value=="boolean"?"top":o.value;return[n.value?{top:"auto",bottom:"auto",height:void 0}:void 0,o.value?{[v]:ta(l.value)}:{top:t.value.top}]});fe(()=>{z(n,v=>{v?window.addEventListener("scroll",c,{passive:!0}):window.removeEventListener("scroll",c)},{immediate:!0})}),ke(()=>{window.removeEventListener("scroll",c)});let u=0;function c(){const v=u>window.scrollY?"up":"down",f=a.value.getBoundingClientRect(),m=parseFloat(t.value.top??0),y=window.scrollY-Math.max(0,l.value-m),h=f.height+Math.max(l.value,m)-window.scrollY-window.innerHeight,r=parseFloat(getComputedStyle(a.value).getPropertyValue("--v-body-scroll-y"))||0;f.height0;n--){if(e[n].t===e[n-1].t)continue;const t=lt(a),o=(e[n].d-e[n-1].d)/(e[n].t-e[n-1].t);a+=(o-t)*Math.abs(o),n===e.length-1&&(a*=.5)}return lt(a)*1e3}function Dn(){const e={};function a(o){Array.from(o.changedTouches).forEach(l=>{(e[l.identifier]??(e[l.identifier]=new aa(Ln))).push([o.timeStamp,l])})}function n(o){Array.from(o.changedTouches).forEach(l=>{delete e[l.identifier]})}function t(o){var v;const l=(v=e[o])==null?void 0:v.values().reverse();if(!l)throw new Error(`No samples for touch id ${o}`);const s=l[0],u=[],c=[];for(const f of l){if(s[0]-f[0]>jn)break;u.push({t:f[0],d:f[1].clientX}),c.push({t:f[0],d:f[1].clientY})}return{x:st(u),y:st(c),get direction(){const{x:f,y:m}=this,[y,h]=[Math.abs(f),Math.abs(m)];return y>h&&f>=0?"right":y>h&&f<=0?"left":h>y&&m>=0?"down":h>y&&m<=0?"up":In()}}}return{addMovement:a,endTouch:n,getVelocity:t}}function In(){throw new Error}function Mn(e){let{el:a,isActive:n,isTemporary:t,width:o,touchless:l,position:s}=e;fe(()=>{window.addEventListener("touchstart",D,{passive:!0}),window.addEventListener("touchmove",S,{passive:!1}),window.addEventListener("touchend",R,{passive:!0})}),ke(()=>{window.removeEventListener("touchstart",D),window.removeEventListener("touchmove",S),window.removeEventListener("touchend",R)});const u=w(()=>["left","right"].includes(s.value)),{addMovement:c,endTouch:v,getVelocity:f}=Dn();let m=!1;const y=q(!1),h=q(0),r=q(0);let g;function p(_,b){return(s.value==="left"?_:s.value==="right"?document.documentElement.clientWidth-_:s.value==="top"?_:s.value==="bottom"?document.documentElement.clientHeight-_:re())-(b?o.value:0)}function k(_){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const C=s.value==="left"?(_-r.value)/o.value:s.value==="right"?(document.documentElement.clientWidth-_-r.value)/o.value:s.value==="top"?(_-r.value)/o.value:s.value==="bottom"?(document.documentElement.clientHeight-_-r.value)/o.value:re();return b?Math.max(0,Math.min(1,C)):C}function D(_){if(l.value)return;const b=_.changedTouches[0].clientX,C=_.changedTouches[0].clientY,O=25,j=s.value==="left"?bdocument.documentElement.clientWidth-O:s.value==="top"?Cdocument.documentElement.clientHeight-O:re(),A=n.value&&(s.value==="left"?bdocument.documentElement.clientWidth-o.value:s.value==="top"?Cdocument.documentElement.clientHeight-o.value:re());(j||A||n.value&&t.value)&&(g=[b,C],r.value=p(u.value?b:C,n.value),h.value=k(u.value?b:C),m=r.value>-20&&r.value<80,v(_),c(_))}function S(_){const b=_.changedTouches[0].clientX,C=_.changedTouches[0].clientY;if(m){if(!_.cancelable){m=!1;return}const j=Math.abs(b-g[0]),A=Math.abs(C-g[1]);(u.value?j>A&&j>3:A>j&&A>3)?(y.value=!0,m=!1):(u.value?A:j)>3&&(m=!1)}if(!y.value)return;_.preventDefault(),c(_);const O=k(u.value?b:C,!1);h.value=Math.max(0,Math.min(1,O)),O>1?r.value=p(u.value?b:C,!0):O<0&&(r.value=p(u.value?b:C,!1))}function R(_){if(m=!1,!y.value)return;c(_),y.value=!1;const b=f(_.changedTouches[0].identifier),C=Math.abs(b.x),O=Math.abs(b.y);(u.value?C>O&&C>400:O>C&&O>3)?n.value=b.direction===({left:"right",right:"left",top:"down",bottom:"up"}[s.value]||re()):n.value=h.value>.5}const I=w(()=>y.value?{transform:s.value==="left"?`translateX(calc(-100% + ${h.value*o.value}px))`:s.value==="right"?`translateX(calc(100% - ${h.value*o.value}px))`:s.value==="top"?`translateY(calc(-100% + ${h.value*o.value}px))`:s.value==="bottom"?`translateY(calc(100% - ${h.value*o.value}px))`:re(),transition:"none"}:void 0);return de(y,()=>{var C,O;const _=((C=a.value)==null?void 0:C.style.transform)??null,b=((O=a.value)==null?void 0:O.style.transition)??null;$t(()=>{var j,A,G,ne;(A=a.value)==null||A.style.setProperty("transform",((j=I.value)==null?void 0:j.transform)||"none"),(ne=a.value)==null||ne.style.setProperty("transition",((G=I.value)==null?void 0:G.transition)||null)}),na(()=>{var j,A;(j=a.value)==null||j.style.setProperty("transform",_),(A=a.value)==null||A.style.setProperty("transition",b)})}),{isDragging:y,dragProgress:h,dragStyles:I}}function re(){throw new Error}const Bn=["start","end","left","right","top","bottom"],zn=me({color:String,disableResizeWatcher:Boolean,disableRouteWatcher:Boolean,expandOnHover:Boolean,floating:Boolean,modelValue:{type:Boolean,default:null},permanent:Boolean,rail:{type:Boolean,default:null},railWidth:{type:[Number,String],default:56},scrim:{type:[Boolean,String],default:!0},image:String,temporary:Boolean,persistent:Boolean,touchless:Boolean,width:{type:[Number,String],default:256},location:{type:String,default:"start",validator:e=>Bn.includes(e)},sticky:Boolean,...ra(),...ze(),...oa(),...la({mobile:null}),...sa(),...wt(),...ia(),...kt({tag:"nav"}),...ht()},"VNavigationDrawer"),it=Ve()({name:"VNavigationDrawer",props:zn(),emits:{"update:modelValue":e=>!0,"update:rail":e=>!0},setup(e,a){let{attrs:n,emit:t,slots:o}=a;const{isRtl:l}=yt(),{themeClasses:s}=pt(e),{borderClasses:u}=ua(e),{backgroundColorClasses:c,backgroundColorStyles:v}=Ge(ye(e,"color")),{elevationClasses:f}=ca(e),{displayClasses:m,mobile:y}=Vt(e),{roundedClasses:h}=da(e),r=va(),g=_t(e,"modelValue",null,T=>!!T),{ssrBootStyles:p}=Ne(),{scopeId:k}=fa(),D=x(),S=q(!1),{runOpenDelay:R,runCloseDelay:I}=ya(e,T=>{S.value=T}),_=w(()=>e.rail&&e.expandOnHover&&S.value?Number(e.width):Number(e.rail?e.railWidth:e.width)),b=w(()=>ma(e.location,l.value)),C=w(()=>e.persistent),O=w(()=>!e.permanent&&(y.value||e.temporary)),j=w(()=>e.sticky&&!O.value&&b.value!=="bottom");de(()=>e.expandOnHover&&e.rail!=null,()=>{z(S,T=>t("update:rail",!T))}),de(()=>!e.disableResizeWatcher,()=>{z(O,T=>!e.permanent&&Ae(()=>g.value=!T))}),de(()=>!e.disableRouteWatcher&&!!r,()=>{z(r.currentRoute,()=>O.value&&(g.value=!1))}),z(()=>e.permanent,T=>{T&&(g.value=!0)}),e.modelValue==null&&!O.value&&(g.value=e.permanent||!y.value);const{isDragging:A,dragProgress:G}=Mn({el:D,isActive:g,isTemporary:O,width:_,touchless:ye(e,"touchless"),position:b}),ne=w(()=>{const T=O.value?0:e.rail&&e.expandOnHover?Number(e.railWidth):_.value;return A.value?T*G.value:T}),Ce=w(()=>["top","bottom"].includes(e.location)?0:_.value),{layoutItemStyles:ie,layoutItemScrimStyles:Oe,layoutIsReady:Re}=bt({id:e.name,order:w(()=>parseInt(e.order,10)),position:b,layoutSize:ne,elementSize:Ce,active:w(()=>g.value||A.value),disableTransitions:w(()=>A.value),absolute:w(()=>e.absolute||j.value&&typeof ge.value!="string")}),{isStuck:ge,stickyStyles:Pe}=An({rootEl:D,isSticky:j,layoutItemStyles:ie}),E=Ge(w(()=>typeof e.scrim=="string"?e.scrim:null)),Q=w(()=>({...A.value?{opacity:G.value*.2,transition:"none"}:void 0,...Oe.value}));return ga({VList:{bgColor:"transparent"}}),Se(()=>{const T=o.image||e.image;return i(J,null,[i(e.tag,U({ref:D,onMouseenter:R,onMouseleave:I,class:["v-navigation-drawer",`v-navigation-drawer--${b.value}`,{"v-navigation-drawer--expand-on-hover":e.expandOnHover,"v-navigation-drawer--floating":e.floating,"v-navigation-drawer--is-hovering":S.value,"v-navigation-drawer--rail":e.rail,"v-navigation-drawer--temporary":O.value,"v-navigation-drawer--persistent":C.value,"v-navigation-drawer--active":g.value,"v-navigation-drawer--sticky":j.value},s.value,c.value,u.value,m.value,f.value,h.value,e.class],style:[v.value,ie.value,p.value,Pe.value,e.style,["top","bottom"].includes(b.value)?{height:"auto"}:{}]},k,n),{default:()=>{var Fe,Ue,We;return[T&&i("div",{key:"image",class:"v-navigation-drawer__img"},[o.image?i(ha,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{alt:"",cover:!0,height:"inherit",src:e.image}}},o.image):i(Be,{key:"image-img",alt:"",cover:!0,height:"inherit",src:e.image},null)]),o.prepend&&i("div",{class:"v-navigation-drawer__prepend"},[(Fe=o.prepend)==null?void 0:Fe.call(o)]),i("div",{class:"v-navigation-drawer__content"},[(Ue=o.default)==null?void 0:Ue.call(o)]),o.append&&i("div",{class:"v-navigation-drawer__append"},[(We=o.append)==null?void 0:We.call(o)])]}}),i(pa,{name:"fade-transition"},{default:()=>[O.value&&(A.value||g.value)&&!!e.scrim&&i("div",U({class:["v-navigation-drawer__scrim",E.backgroundColorClasses.value],style:[Q.value,E.backgroundColorStyles.value],onClick:()=>{C.value||(g.value=!1)}},k),null)]})])}),Re.then(()=>({isStuck:ge}))}}),Nn={components:{AuthForm:tn,OnlineUsers:on,CardLike:vn,VcardUser:Sa,PageCounter:bn,DefaultPortalMenuList:Sn},mixins:[wa],setup(){const{name:e}=Vt(),a=_a(),n=Oa(),t=Ie(),o=x(!0),l=x(!0),s=x(!1),u=x(!1),c=x(!1),v=x(!1),f=ce.slice(0,-1),m=x([]),y=w({get:()=>!1});(()=>{t.cod2user||ut.get("api/navigation/screensaver/").then(_=>{console.log(_,"saver--")})})();const r=_=>_.slice(0,2).toUpperCase(),g=()=>{a.global.name.value=a.global.current.value.dark?"light":"dark"};n.loadlinks();const k=[{name:"Gitt",ico:"mdi-github",link:(()=>ce=="http://127.0.0.1:8000/"?"http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects":"http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22")()},{name:"Swagger",ico:"mdi-puzzle",link:"http://127.0.0.1:8000/swagger/"}],D=x([{name:"Новости",ico:"mdi-newspaper",path:"/news"},{name:"Структура",ico:"mdi-source-branch",submenu:[{name:"ОКиБ",path:"/okib"}]},{name:"Сотрудники",ico:"mdi-account-multiple-outline",submenu:[{name:"Справочник",link:"http://10.252.44.33/accounting6/members.php"}]},{name:"Календарь",ico:"mdi-calendar",path:"/ical"},{name:"Голосование",ico:"mdi-vote",path:"/vote"},{name:"Об инспекции",ico:"mdi-city",path:"/inspection"},{name:"О портале",ico:"mdi-information-variant",path:"/portal"}]),S=w(()=>new URL("/assets/FNS-logo-xs-e0e2f5b0.png",self.location).href),R=()=>{s.value=!1};return(()=>{pe.get("api/safety/gettypes/").then(_=>{if(_.data.forEach(b=>{b.path.startsWith("/")||(b.path="/"+b.path),b.path="/safety"+b.path}),_.data.length>0){let b={name:"Безопасность",ico:"mdi-security",submenu:_.data};D.value.splice(4,0,b)}})})(),{theme:a,mainmenuStore:n,accountStore:t,drawer:o,drawer_right:l,toggleTheme:g,navigations:D,imageSrc:S,LikeDialog:s,scrimg:m,oRasrab:k,rail:u,showTooltip:c,menuTruncated:r,alert:v,burl:f,name:e,closeinfo:R,baseURL:ce,getDevelopment:je,message:y}}},Hn=B("span",null,"F.A.Q.",-1),Fn=B("span",null," Сменить тему",-1),Un=B("span",null," Выход ",-1);function Wn(e,a,n,t,o,l){const s=X("vcard-user"),u=X("Card-like"),c=X("Auth-form"),v=X("default-portal-menu-list"),f=X("page-counter"),m=X("router-view"),y=X("alert-default"),h=X("Online-users");return $(),P(Cn,null,{default:d(()=>[i(En,{elevation:t.accountStore.cod2user?2:0,density:"compact",color:"app_bar",class:"pl-4"},{image:d(()=>[i(Be,{class:"bggrad"})]),append:d(()=>[t.accountStore.cod2user?($(),H(J,{key:0},[i(s,{author:t.accountStore.user},null,8,["author"]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white"},r,{dark:"",to:"/faq",icon:"mdi-comment-question-outline"}),null,16)]),default:d(()=>[Hn]),_:1}),i(gt,{modelValue:t.LikeDialog,"onUpdate:modelValue":a[2]||(a[2]=r=>t.LikeDialog=r),persistent:"",width:"800"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white"},r,{dark:"",icon:"mdi-thumb-up-outline"}),{default:d(()=>[i(W),i(F,{activator:"parent",location:"bottom"},{default:d(()=>[L("Обратная связь")]),_:1})]),_:2},1040)]),default:d(()=>[i(u,{LikeDialog:t.LikeDialog,onMenusClose:a[1]||(a[1]=r=>t.closeinfo())},null,8,["LikeDialog"])]),_:1},8,["modelValue"]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,{icon:"",onClick:t.toggleTheme},{default:d(()=>[i(W,U(r,{class:"mr-1",color:"lampa"}),{default:d(()=>[L(" mdi-lightbulb-outline ")]),_:2},1040)]),_:2},1032,["onClick"])]),default:d(()=>[Fn]),_:1}),ft(i(ue,{class:"",width:"50"},{default:d(()=>[L(M(t.name),1)]),_:1},512),[[mt,t.message]]),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white",icon:"mdi-account-multiple-outline",onClick:a[3]||(a[3]=g=>t.drawer_right=!t.drawer_right)},r),null,16)]),default:d(()=>[B("span",null,M(t.drawer_right==!0?"Скрыть пользователей":"Показать пользователей"),1)]),_:1}),i(F,{location:"bottom"},{activator:d(({props:r})=>[i(Y,U({color:"black_and_white",icon:"mdi-logout",onClick:t.accountStore.logout},r),null,16,["onClick"])]),default:d(()=>[Un]),_:1})],64)):($(),P(K,{key:1,justify:"center"},{default:d(()=>[i(c,{onChallengealert:a[4]||(a[4]=r=>t.alert=!0)})]),_:1}))]),default:d(()=>[t.accountStore.cod2user?($(),P(W,{key:0,class:"px-3",size:"20",color:"black_and_white",icon:t.rail?"mdi-chevron-right":"mdi-chevron-left",onClick:a[0]||(a[0]=r=>t.rail=!t.rail)},null,8,["icon"])):N("",!0),t.accountStore.cod2user?($(),P(ue,{key:1,class:"bg-transparent py",color:"black_and_white",density:"compact","prepend-avatar":t.imageSrc,title:"Портал МИ ФНС России по ЦОД № 2",variant:"text",to:"/"},null,8,["prepend-avatar"])):N("",!0)]),_:1},8,["elevation"]),t.accountStore.cod2user?($(),P(it,{key:0,width:245,rail:t.rail,permanent:"",modelValue:t.drawer,"onUpdate:modelValue":a[5]||(a[5]=r=>t.drawer=r)},{default:d(()=>[i(K,{class:"my-0 h-100"},{default:d(()=>[i(Z,{class:"flex-column d-flex"},{default:d(()=>[i(K,null,{default:d(()=>[i(Z,null,{default:d(()=>[i(we,{nav:"",density:"compact"},{default:d(()=>[($(!0),H(J,null,le(t.navigations,(r,g)=>($(),H(J,null,[(r.path!="/portal"||t.accountStore.user.is_superuser)&&!("submenu"in r)?($(),P(ae,{key:r.key,title:r.name,value:r.name,href:r.link,disabled:r.path=="",to:r.path,target:r.link?"_blank":"",color:"navigation"},{prepend:d(()=>[i(W,{icon:r.ico},null,8,["icon"]),t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["title","value","href","disabled","to","target"])):N("",!0),r.path!="/portal"&&"submenu"in r?($(),P(xa,{class:ba(t.rail?"railmenu":""),key:g,value:r.name},{activator:d(({props:p})=>[i(ae,U({ref_for:!0},p,{title:r.name,"prepend-icon":r.ico,color:"navigation"}),{default:d(()=>[t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1040,["title","prepend-icon"])]),default:d(()=>[($(!0),H(J,null,le(r.submenu,(p,k)=>($(),P(ae,{color:"navigation",href:p.link,key:k,value:p.name,title:t.rail?t.menuTruncated(p.name):p.name,to:p.path,target:p.link?"_blank":""},{default:d(()=>[t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(p.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["href","value","title","to","target"]))),128))]),_:2},1032,["class","value"])):N("",!0)],64))),256))]),_:1}),i(we,{nav:"",density:"compact"},{default:d(()=>[($(!0),H(J,null,le(t.mainmenuStore.portallinks,r=>($(),P(ae,{key:r.name,title:r.name,value:r.name,href:r.link,color:"app_bar",target:r.link?"_blank":""},{prepend:d(()=>[i(W,{icon:r.imagecode},null,8,["icon"]),t.rail?($(),P(F,{key:0,activator:"parent",location:"top"},{default:d(()=>[L(M(r.name),1)]),_:2},1024)):N("",!0)]),_:2},1032,["title","value","href","target"]))),128))]),_:1})]),_:1})]),_:1}),t.accountStore.user.is_staff?($(),P(K,{key:0,class:"flex-grow-0"},{default:d(()=>[i(Z,null,{default:d(()=>[i(v,{rail:t.rail},null,8,["rail"])]),_:1})]),_:1})):N("",!0),i(K,{"no-gutters":"",class:"flex-grow-0"},{default:d(()=>[i(Z,null,{default:d(()=>[i(f,{rail:t.rail},null,8,["rail"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["rail","modelValue"])):N("",!0),t.accountStore.cod2user?($(),P(ot,{key:1,class:"d-flex bg-main_theme"},{default:d(()=>[i(m),i(y)]),_:1})):($(),P(ot,{key:2,class:"d-flex align-center text-h3 bg-teal-lighten-2"},{default:d(()=>[i(ue,{class:"h-100 w-100 d-flex justify-center rounded-0 flex-column",image:`${t.burl}${t.scrimg}`},{default:d(()=>[i(Me,{class:"justify-center bgCard h-100 ma-3 d-flex flex-column"},{default:d(()=>[i(K,{class:"bgText flex-grow-0"},{default:d(()=>[i(Z,{class:"text-center textcolor font-weight-black text-h3 pb-0"},{default:d(()=>[L(" Добро пожаловать на портал МИ ФНС России по ЦОД № 2 ")]),_:1})]),_:1}),i(K,{class:"bgText flex-grow-0"},{default:d(()=>[i(Z,{class:"text-subtitle-1 text-center textcolor pt-0"},{default:d(()=>[L(" Авторизуйтесь для получения доступа к контенту портала ")]),_:1})]),_:1})]),_:1})]),_:1},8,["image"]),i(y)]),_:1})),t.accountStore.cod2user?($(),P(it,{key:3,modelValue:t.drawer_right,"onUpdate:modelValue":a[6]||(a[6]=r=>t.drawer_right=r),rail:"",permanent:"",location:"right",onClick:a[7]||(a[7]=r=>t.rail=!1)},{default:d(()=>[i(h)]),_:1},8,["modelValue"])):N("",!0)]),_:1})}const lr=se(Nn,[["render",Wn]]);export{lr as default}; diff --git a/src/front/dist/assets/FAQPage-7d4b36d0.js b/src/front/dist/assets/FAQPage-981efe68.js similarity index 82% rename from src/front/dist/assets/FAQPage-7d4b36d0.js rename to src/front/dist/assets/FAQPage-981efe68.js index e18f475ea..4af683af7 100644 --- a/src/front/dist/assets/FAQPage-7d4b36d0.js +++ b/src/front/dist/assets/FAQPage-981efe68.js @@ -1 +1 @@ -import{_ as t,cV as a,s,t as c,v as e,D as o,x as r,y as n,E as l}from"./index-84cc8e63.js";const _={setup(){a()}};function f(p,x,i,u,d,g){return s(),c(o,null,{default:e(()=>[r(l,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:e(()=>[n(" F.A.Q. ")]),_:1})]),_:1})}const V=t(_,[["render",f]]);export{V as default}; +import{_ as t,cV as a,s,t as c,v as e,D as o,x as r,y as n,E as l}from"./index-f3f24177.js";const _={setup(){a()}};function f(p,x,i,u,d,g){return s(),c(o,null,{default:e(()=>[r(l,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:e(()=>[n(" F.A.Q. ")]),_:1})]),_:1})}const V=t(_,[["render",f]]);export{V as default}; diff --git a/src/front/dist/assets/FeedbackPage-d5e8e0ff.js b/src/front/dist/assets/FeedbackPage-ce0345b3.js similarity index 83% rename from src/front/dist/assets/FeedbackPage-d5e8e0ff.js rename to src/front/dist/assets/FeedbackPage-ce0345b3.js index 06a3a5833..6c6a98957 100644 --- a/src/front/dist/assets/FeedbackPage-d5e8e0ff.js +++ b/src/front/dist/assets/FeedbackPage-ce0345b3.js @@ -1 +1 @@ -import{_ as t,s as a,t as s,v as e,D as c,x as o,y as r,E as n}from"./index-84cc8e63.js";const l={setup(){}};function _(f,x,d,i,p,u){return a(),s(c,null,{default:e(()=>[o(n,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:e(()=>[r(" Обратная связь ")]),_:1})]),_:1})}const h=t(l,[["render",_]]);export{h as default}; +import{_ as t,s as a,t as s,v as e,D as c,x as o,y as r,E as n}from"./index-f3f24177.js";const l={setup(){}};function _(f,x,d,i,p,u){return a(),s(c,null,{default:e(()=>[o(n,{class:"text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"},{default:e(()=>[r(" Обратная связь ")]),_:1})]),_:1})}const h=t(l,[["render",_]]);export{h as default}; diff --git a/src/front/dist/assets/FnsHol-70c9f2fd.js b/src/front/dist/assets/FnsHol-ef7b2a9e.js similarity index 82% rename from src/front/dist/assets/FnsHol-70c9f2fd.js rename to src/front/dist/assets/FnsHol-ef7b2a9e.js index 291ae06db..f736a40ac 100644 --- a/src/front/dist/assets/FnsHol-70c9f2fd.js +++ b/src/front/dist/assets/FnsHol-ef7b2a9e.js @@ -1 +1 @@ -import{_ as f,r as p,U as _,f as h,s,t as n,v as e,a5 as x,R as g,T as V,S as b,x as a,K as w,B as k,D as u,E as r,y as v,$ as C,X as d,C as y,a0 as T}from"./index-84cc8e63.js";import{V as $,a as B}from"./VCarouselItem-6ed5cbbb.js";import{V as F}from"./VContainer-508c7a47.js";import{V as H}from"./VTextarea-08b60249.js";import"./VWindowItem-bd3460f3.js";import"./ssrBoot-04c9ae84.js";/* empty css */import"./VField-e3c852c7.js";import"./VInput-e5a7e0e7.js";const I={setup(){const c=x.slice(0,-1),o=p([{link:""}]);_.get("api/fns/links/").then(t=>{o.value=t.data});const i=h(()=>window.innerHeight-50);return{burl:c,carous:o,carushi:i}}};function N(c,o,i,t,R,D){return s(),n($,{cover:"",height:t.carushi,"hide-delimiters":"","hide-delimiter-background":"","show-arrows":"hover",color:"white"},{default:e(()=>[(s(!0),g(b,null,V(t.carous,(l,m)=>(s(),n(B,{key:m,src:`${t.burl}${l.link}`,cover:"",eager:""},{default:e(()=>[a(F,{"fill-height":"",fluid:"","pa-0":"","ma-0":"","pb-3":"",class:"flex-column h-100 d-flex"},{default:e(()=>[a(w,{class:"bgCard h-100 d-flex flex-column"},{default:e(()=>[a(k,{class:"ma-2 text-h3 text-uppercase titles py-5 flex-column"},{default:e(()=>[a(u,null,{default:e(()=>[a(r,{class:"pa-0 pl-1 align-self-center"},{default:e(()=>[v(C(l.title),1)]),_:2},1024),a(r,{class:"flex-grow-0 pa-0 pr-1"},{default:e(()=>[a(d,{width:"50","aspect-ratio":1,src:`${t.burl}${l.sender}`,cover:""},null,8,["src"])]),_:2},1024)]),_:2},1024)]),_:2},1024),"text"in l&&l.text.length>0?(s(),n(y,{key:0,class:"ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1"},{default:e(()=>[a(u,null,{default:e(()=>[a(r,{cols:"6",class:"bgText"},{default:e(()=>[a(H,{class:"mt-n3 text-black textareas pt-2 font-weight-medium","model-value":l.text,variant:"plain",readonly:"","auto-grow":"",rows:"1","hide-details":""},null,8,["model-value"])]),_:2},1024),a(r,{cols:"6",class:"bgText"},{default:e(()=>[a(d,{"aspect-ratio":1,src:`${t.burl}${l.link2}`},null,8,["src"])]),_:2},1024)]),_:2},1024)]),_:2},1024)):T("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1032,["src"]))),128))]),_:1},8,["height"])}const z=f(I,[["render",N]]);export{z as default}; +import{_ as f,r as p,U as _,f as h,s,t as n,v as e,a5 as x,R as g,T as V,S as b,x as a,K as w,B as k,D as u,E as r,y as v,$ as C,X as d,C as y,a0 as T}from"./index-f3f24177.js";import{V as $,a as B}from"./VCarouselItem-006fdf8a.js";import{V as F}from"./VContainer-1fb03ac7.js";import{V as H}from"./VTextarea-d04410cf.js";import"./VWindowItem-903bb0f4.js";import"./ssrBoot-4527a6ac.js";/* empty css */import"./VField-ac1e4507.js";import"./VInput-3de7b4b2.js";const I={setup(){const c=x.slice(0,-1),o=p([{link:""}]);_.get("api/fns/links/").then(t=>{o.value=t.data});const i=h(()=>window.innerHeight-50);return{burl:c,carous:o,carushi:i}}};function N(c,o,i,t,R,D){return s(),n($,{cover:"",height:t.carushi,"hide-delimiters":"","hide-delimiter-background":"","show-arrows":"hover",color:"white"},{default:e(()=>[(s(!0),g(b,null,V(t.carous,(l,m)=>(s(),n(B,{key:m,src:`${t.burl}${l.link}`,cover:"",eager:""},{default:e(()=>[a(F,{"fill-height":"",fluid:"","pa-0":"","ma-0":"","pb-3":"",class:"flex-column h-100 d-flex"},{default:e(()=>[a(w,{class:"bgCard h-100 d-flex flex-column"},{default:e(()=>[a(k,{class:"ma-2 text-h3 text-uppercase titles py-5 flex-column"},{default:e(()=>[a(u,null,{default:e(()=>[a(r,{class:"pa-0 pl-1 align-self-center"},{default:e(()=>[v(C(l.title),1)]),_:2},1024),a(r,{class:"flex-grow-0 pa-0 pr-1"},{default:e(()=>[a(d,{width:"50","aspect-ratio":1,src:`${t.burl}${l.sender}`,cover:""},null,8,["src"])]),_:2},1024)]),_:2},1024)]),_:2},1024),"text"in l&&l.text.length>0?(s(),n(y,{key:0,class:"ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1"},{default:e(()=>[a(u,null,{default:e(()=>[a(r,{cols:"6",class:"bgText"},{default:e(()=>[a(H,{class:"mt-n3 text-black textareas pt-2 font-weight-medium","model-value":l.text,variant:"plain",readonly:"","auto-grow":"",rows:"1","hide-details":""},null,8,["model-value"])]),_:2},1024),a(r,{cols:"6",class:"bgText"},{default:e(()=>[a(d,{"aspect-ratio":1,src:`${t.burl}${l.link2}`},null,8,["src"])]),_:2},1024)]),_:2},1024)]),_:2},1024)):T("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1032,["src"]))),128))]),_:1},8,["height"])}const z=f(I,[["render",N]]);export{z as default}; diff --git a/src/front/dist/assets/HomePage-d0feb78a.js b/src/front/dist/assets/HomePage-dfd0ceee.js similarity index 99% rename from src/front/dist/assets/HomePage-d0feb78a.js rename to src/front/dist/assets/HomePage-dfd0ceee.js index f4643e984..60610c141 100644 --- a/src/front/dist/assets/HomePage-d0feb78a.js +++ b/src/front/dist/assets/HomePage-dfd0ceee.js @@ -1,4 +1,4 @@ -import{aQ as ST,aR as BT,aS as NT,aT as OT,aU as PT,aV as LT,aW as zT,S as He,aX as RT,aY as jT,aZ as FT,ag as VT,a_ as HT,a$ as UT,b0 as WT,aL as Ko,b1 as Gb,b2 as qT,b3 as GT,b4 as $T,b5 as KT,b6 as YT,b7 as QT,b8 as ZT,b9 as JT,ba as XT,f as Zo,bb as eM,t as pe,a0 as ce,R as J,M as we,bc as tM,bd as nM,be as iM,bf as oM,bg as As,bh as rM,y as ze,x as j,bi as sM,bj as aM,bk as cM,bl as lM,bm as dM,bn as uM,bo as hM,bp as gM,bq as mM,br as pM,bs as fM,bt as kM,bu as bM,bv as wM,a as _M,bw as AM,bx as CM,by as vM,bz as yM,bA as xM,bB as DM,bC as EM,bD as TM,bE as MM,k as IM,bF as SM,bG as BM,h as NM,j as OM,i as PM,bH as LM,bI as zM,bJ as RM,bK as jM,bL as FM,bM as VM,z as hn,n as HM,aP as dt,bN as Fc,bO as St,bP as UM,o as WM,e as qM,bQ as GM,bR as $M,bS as KM,q as vs,bT as YM,bU as QM,av as ZM,bV as JM,bW as XM,bX as eI,s as W,bY as tI,p as nI,bZ as iI,b_ as oI,b$ as rI,b as sI,c0 as aI,r as me,c1 as cI,c2 as lI,T as Qe,c3 as ve,Q as ut,c4 as dI,c5 as Wc,c6 as uI,c7 as hI,c8 as gI,c9 as mI,ca as pI,cb as fI,cc as kI,ah as bI,cd as wI,ce as _I,cf as AI,$ as ue,cg as CI,ch as vI,ci as yI,an as xI,cj as DI,ck as EI,cl as TI,cm as MI,u as II,cn as SI,co as BI,cp as NI,cq as OI,cr as PI,cs as LI,ct as zI,cu as RI,cv as jI,cw as FI,cx as VI,cy as HI,H as $b,cz as UI,cA as WI,w as qI,ao as GI,cB as $I,cC as KI,cD as YI,v as R,cE as QI,G as Kb,J as Vc,cF as ZI,cG as ai,cH as JI,_ as en,Y as XI,a5 as $i,U as yn,K as nt,B as Rn,D as Ve,E as Ie,X as ys,C as ci,ab as eS,cI as tS,cJ as nS,cK as iS,cL as Yb,cM as Qb,cN as oS,Z as Yo,A as di,L as xs,O as Zb,P as Jb,F as qc,l as Xb,cO as ae,cP as rS,g as ew,cQ as zn,I as sS,cR as tw,a3 as Hc,cS as aS,a2 as cS,cT as nw,V as li,a4 as iw,cU as lS,m as dS,cV as uS,cW as hS}from"./index-84cc8e63.js";import{V as gS,a as mS}from"./VCarouselItem-6ed5cbbb.js";import{V as Gc}from"./VContainer-508c7a47.js";import{V as Uc}from"./VTextarea-08b60249.js";import{n as pS}from"./news-card-ca3b0a09.js";import{L as fS}from"./load-round-e6ddd692.js";import{V as kS}from"./vcardUser-4537db13.js";import{V as Qo}from"./VTextField-4eb073db.js";import{V as $c,b as bS}from"./VList-d0850642.js";import{V as ow}from"./VSwitch-17908f52.js";import{V as rw}from"./VFileInput-ac5ef80a.js";import{V as wS}from"./VForm-22e5b970.js";import{V as _S}from"./VAutocomplete-4b4c3aba.js";import{V as AS}from"./VSpacer-bea6911b.js";import{V as CS,a as vS}from"./VLocaleProvider-396cfd34.js";import"./VWindowItem-bd3460f3.js";import"./ssrBoot-04c9ae84.js";/* empty css */import"./VField-e3c852c7.js";import"./VInput-e5a7e0e7.js";import"./icoUser-ad360f3a.js";import"./VSelectionControl-b8db7e28.js";import"./VSelect-db8f1e56.js";import"./VVirtualScroll-9b239331.js";import"./VCheckboxBtn-c07777d8.js";/** +import{aQ as ST,aR as BT,aS as NT,aT as OT,aU as PT,aV as LT,aW as zT,S as He,aX as RT,aY as jT,aZ as FT,ag as VT,a_ as HT,a$ as UT,b0 as WT,aL as Ko,b1 as Gb,b2 as qT,b3 as GT,b4 as $T,b5 as KT,b6 as YT,b7 as QT,b8 as ZT,b9 as JT,ba as XT,f as Zo,bb as eM,t as pe,a0 as ce,R as J,M as we,bc as tM,bd as nM,be as iM,bf as oM,bg as As,bh as rM,y as ze,x as j,bi as sM,bj as aM,bk as cM,bl as lM,bm as dM,bn as uM,bo as hM,bp as gM,bq as mM,br as pM,bs as fM,bt as kM,bu as bM,bv as wM,a as _M,bw as AM,bx as CM,by as vM,bz as yM,bA as xM,bB as DM,bC as EM,bD as TM,bE as MM,k as IM,bF as SM,bG as BM,h as NM,j as OM,i as PM,bH as LM,bI as zM,bJ as RM,bK as jM,bL as FM,bM as VM,z as hn,n as HM,aP as dt,bN as Fc,bO as St,bP as UM,o as WM,e as qM,bQ as GM,bR as $M,bS as KM,q as vs,bT as YM,bU as QM,av as ZM,bV as JM,bW as XM,bX as eI,s as W,bY as tI,p as nI,bZ as iI,b_ as oI,b$ as rI,b as sI,c0 as aI,r as me,c1 as cI,c2 as lI,T as Qe,c3 as ve,Q as ut,c4 as dI,c5 as Wc,c6 as uI,c7 as hI,c8 as gI,c9 as mI,ca as pI,cb as fI,cc as kI,ah as bI,cd as wI,ce as _I,cf as AI,$ as ue,cg as CI,ch as vI,ci as yI,an as xI,cj as DI,ck as EI,cl as TI,cm as MI,u as II,cn as SI,co as BI,cp as NI,cq as OI,cr as PI,cs as LI,ct as zI,cu as RI,cv as jI,cw as FI,cx as VI,cy as HI,H as $b,cz as UI,cA as WI,w as qI,ao as GI,cB as $I,cC as KI,cD as YI,v as R,cE as QI,G as Kb,J as Vc,cF as ZI,cG as ai,cH as JI,_ as en,Y as XI,a5 as $i,U as yn,K as nt,B as Rn,D as Ve,E as Ie,X as ys,C as ci,ab as eS,cI as tS,cJ as nS,cK as iS,cL as Yb,cM as Qb,cN as oS,Z as Yo,A as di,L as xs,O as Zb,P as Jb,F as qc,l as Xb,cO as ae,cP as rS,g as ew,cQ as zn,I as sS,cR as tw,a3 as Hc,cS as aS,a2 as cS,cT as nw,V as li,a4 as iw,cU as lS,m as dS,cV as uS,cW as hS}from"./index-f3f24177.js";import{V as gS,a as mS}from"./VCarouselItem-006fdf8a.js";import{V as Gc}from"./VContainer-1fb03ac7.js";import{V as Uc}from"./VTextarea-d04410cf.js";import{n as pS}from"./news-card-a341a660.js";import{L as fS}from"./load-round-2484bd16.js";import{V as kS}from"./vcardUser-6b6586f8.js";import{V as Qo}from"./VTextField-2c3c89ba.js";import{V as $c,b as bS}from"./VList-983e49dd.js";import{V as ow}from"./VSwitch-1c98fb5a.js";import{V as rw}from"./VFileInput-b0d8c050.js";import{V as wS}from"./VForm-36904946.js";import{V as _S}from"./VAutocomplete-383dbedc.js";import{V as AS}from"./VSpacer-9ba25539.js";import{V as CS}from"./VLocaleProvider-7ac59f8a.js";import{V as vS}from"./VDatePicker-783de65a.js";import"./VWindowItem-903bb0f4.js";import"./ssrBoot-4527a6ac.js";/* empty css */import"./VField-ac1e4507.js";import"./VInput-3de7b4b2.js";import"./icoUser-58919a59.js";import"./VSelectionControl-9e0e68f5.js";import"./VSelect-9ace525e.js";import"./VVirtualScroll-82048add.js";import"./VCheckboxBtn-53ca7935.js";/** * vue v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -8236,4 +8236,4 @@ Read more: ${Ge}#error-${i}`}function Re(i,e){const t=De(i);return e?[i,e,t]:[i, `:i.is("containerElement")||e.is("containerElement")?hm.includes(i.name)||hm.includes(e.name)?` `:` -`:"":""}const qy=function(i,e){return i&&nd(i,e,ao)},Gy=function(i,e,t,n){var o=t.length,r=o,s=!n;if(i==null)return!r;for(i=Object(i);o--;){var a=t[o];if(s&&a[2]?a[1]!==i[a[0]]:!(a[0]in i))return!1}for(;++oe in i?ox(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class No extends G{constructor(){super(...arguments),this._markersToCopy=new Map}static get pluginName(){return"ClipboardMarkersUtils"}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,n=o=>o.model.getSelectedContent(o.model.document.selection)){return this.editor.model.change(o=>{const r=o.model.document.selection;o.setSelection(t);const s=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),a=n(o),c=this._removeFakeMarkersInsideElement(o,a);for(const[l,d]of Object.entries(s)){c[l]||(c[l]=o.createRangeIn(a));for(const u of d)o.remove(u)}a.markers.clear();for(const[l,d]of Object.entries(c))a.markers.set(l,d);return o.setSelection(r),a})}_pasteMarkersIntoTransformedElement(e,t){const n=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(o=>{const r=this._insertFakeMarkersElements(o,n),s=t(o),a=this._removeFakeMarkersInsideElement(o,s);for(const c of Object.values(r).flat())o.remove(c);for(const[c,l]of Object.entries(a))o.model.markers.has(c)||o.addMarker(c,{usingOperation:!0,affectsData:!0,range:l});return s})}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const n of t)e.markers.set(n.name,n.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,n={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const o=this._markersToCopy.get(e);this._markersToCopy.set(e,n),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const n=this._getMarkerClipboardConfig(e);if(!n)return!1;if(!t)return!0;const{allowedActions:o}=n;return o==="all"||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,n){const o=this._getCopyableMarkersFromSelection(e,t,n);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,n){const o=Array.from(t.getRanges()),r=new Set(o.flatMap(s=>Array.from(e.model.markers.getMarkersIntersectingRange(s))));return Array.from(r).filter(s=>{if(!this._isMarkerCopyable(s.name,n))return!1;const{copyPartiallySelected:a}=this._getMarkerClipboardConfig(s.name);if(!a){const c=s.getRange();return o.some(l=>l.containsRange(c,!0))}return!0}).map(s=>({name:n==="dragstart"?this._getUniqueMarkerName(s.name):s.name,range:s.getRange()}))}_getPasteMarkersFromRangeMap(e,t=null){const{model:n}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([o,r])=>{if(!this._hasMarkerConfiguration(o))return[{name:o,range:r}];if(this._isMarkerCopyable(o,t)){const s=this._getMarkerClipboardConfig(o),a=n.markers.has(o)&&n.markers.get(o).getRange().root.rootName==="$graveyard";return(s.duplicateOnPaste||a)&&(o=this._getUniqueMarkerName(o)),[{name:o,range:r}]}return[]})}_insertFakeMarkersElements(e,t){const n={},o=t.flatMap(r=>{const{start:s,end:a}=r.range;return[{position:s,marker:r,type:"start"},{position:a,marker:r,type:"end"}]}).sort(({position:r},{position:s})=>r.isBefore(s)?1:-1);for(const{position:r,marker:s,type:a}of o){const c=e.createElement("$marker",{"data-name":s.name,"data-type":a});n[s.name]||(n[s.name]=[]),n[s.name].push(c),e.insert(c,r)}return n}_removeFakeMarkersInsideElement(e,t){const n=this._getAllFakeMarkersFromElement(e,t).reduce((o,r)=>{const s=r.markerElement&&e.createPositionBefore(r.markerElement);let a=o[r.name],c=!1;a&&a.start&&a.end&&(this._getMarkerClipboardConfig(r.name).duplicateOnPaste?o[this._getUniqueMarkerName(r.name)]=o[r.name]:c=!0,a=null);var l,d;return c||(o[r.name]=(l=((u,h)=>{for(var m in h||(h={}))ax.call(h,m)&&bm(u,m,h[m]);if(km)for(var m of km(h))cx.call(h,m)&&bm(u,m,h[m]);return u})({},a),d={[r.type]:s},rx(l,sx(d)))),r.markerElement&&e.remove(r.markerElement),o},{});return ix(n,o=>new F(o.start||e.createPositionFromPath(t,[0]),o.end||e.createPositionAt(t,"end")))}_getAllFakeMarkersFromElement(e,t){const n=Array.from(e.createRangeIn(t)).flatMap(({item:s})=>{if(!s.is("element","$marker"))return[];const a=s.getAttribute("data-name"),c=s.getAttribute("data-type");return[{markerElement:s,name:a,type:c}]}),o=[],r=[];for(const s of n)s.type==="end"&&(n.some(a=>a.name===s.name&&a.type==="start")||o.push({markerElement:null,name:s.name,type:"start"})),s.type==="start"&&(n.some(a=>a.name===s.name&&a.type==="end")||r.unshift({markerElement:null,name:s.name,type:"end"}));return[...o,...n,...r]}_getUniqueMarkerName(e){const t=e.split(":"),n=$().substring(1,6);return t.length===3?`${t.slice(0,2).join(":")}:${n}`:`${t.join(":")}:${n}`}}class Ft extends G{static get pluginName(){return"ClipboardPipeline"}static get requires(){return[No]}init(){this.editor.editing.view.addObserver(Bo),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,n){const o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:n==="cut"},()=>{const r=o._copySelectedFragmentWithMarkers(n,t);this.fire("outputTransformation",{dataTransfer:e,content:r,method:n})})}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",(s,a)=>{a.method!="paste"||e.model.canEditAt(e.model.document.selection)||s.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(s,a)=>{const c=a.dataTransfer;let l;if(a.content)l=a.content;else{let h="";c.getData("text/html")?h=function(m){return m.replace(/(\s+)<\/span>/g,(k,A)=>A.length==1?" ":A).replace(//g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((d=(d=c.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("

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

${d}

`),h=d),l=this.editor.data.htmlProcessor.toView(h)}var d;const u=new V(this,"inputTransformation");this.fire(u,{content:l,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),u.stop.called&&s.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(s.stop(),t.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,a)=>{a.resultRange=r._pasteFragmentWithMarkers(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document,o=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,t.selection,r.name)};this.listenTo(n,"copy",o,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{e.model.canEditAt(e.model.document.selection)?o(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=e.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",mm(s.content))),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}class wm{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(n,o)=>{o.isLocal&&o.isUndoable&&o!==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(e){this._size+=e,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(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class lx extends de{constructor(e,t){super(e),this._buffer=new wm(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,o=e.text||"",r=o.length;let s=n.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const a=e.resultRange;t.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(c.createText(o,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const _m=["insertText","insertReplacementText"];class dx extends ln{constructor(e){super(e),this.focusObserver=e.getObserver(Br),x.isAndroid&&_m.push("insertCompositionText");const t=e.document;t.on("beforeinput",(n,o)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=o;if(!_m.includes(a))return;this.focusObserver.flush();const l=new V(t,"insertText");t.fire(l,new Mi(e,c,{text:r,selection:e.createSelection(s)})),l.stop.called&&n.stop()}),t.on("compositionend",(n,{data:o,domEvent:r})=>{this.isEnabled&&!x.isAndroid&&o&&t.fire("insertText",new Mi(e,r,{text:o,selection:t.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class Am extends G{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,n=e.editing.view,o=t.document.selection;n.addObserver(dx);const r=new lx(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",r),e.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,u=Array.from(l.getRanges()).map(k=>e.editing.mapper.toModelRange(k));let h=c;if(x.isAndroid){const k=Array.from(u[0].getItems()).reduce((A,E)=>A+(E.is("$textProxy")?E.data:""),"");k&&(k.length<=h.length?h.startsWith(k)&&(h=h.substring(k.length),u[0].start=u[0].start.getShiftedBy(k.length)):k.startsWith(h)&&(u[0].start=u[0].start.getShiftedBy(h.length),h=""))}const m={text:h,selection:t.createSelection(u)};d&&(m.resultRange=e.editing.mapper.toModelRange(d)),e.execute("insertText",m),n.scrollToTheSelection()}),x.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!o.isCollapsed&&a.keyCode==229&&n.document.isComposing&&Cm(t,r)}):this.listenTo(n.document,"compositionstart",()=>{o.isCollapsed||Cm(t,r)})}}function Cm(i,e){if(!e.isEnabled)return;const t=e.buffer;t.lock(),i.enqueueChange(t.batch,()=>{i.deleteContent(i.document.selection)}),t.unlock()}class vm extends de{constructor(e,t){super(e),this.direction=t,this._buffer=new wm(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const r=o.createSelection(e.selection||n.selection);if(!t.canEditAt(r))return;const s=e.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(o);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+=hi(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),o.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o))||!t.schema.checkChild(o,"paragraph"))return!1;const r=o.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(r,o),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const o=e.getFirstPosition(),r=n.schema.getLimitElement(o),s=r.getChild(0);return o.parent==s&&!!e.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const ym="word",Nn="selection",Ri="backward",Oo="forward",xm={deleteContent:{unit:Nn,direction:Ri},deleteContentBackward:{unit:"codePoint",direction:Ri},deleteWordBackward:{unit:ym,direction:Ri},deleteHardLineBackward:{unit:Nn,direction:Ri},deleteSoftLineBackward:{unit:Nn,direction:Ri},deleteContentForward:{unit:"character",direction:Oo},deleteWordForward:{unit:ym,direction:Oo},deleteHardLineForward:{unit:Nn,direction:Oo},deleteSoftLineForward:{unit:Nn,direction:Oo}};class ux extends ln{constructor(e){super(e);const t=e.document;let n=0;t.on("keydown",()=>{n++}),t.on("keyup",()=>{n=0}),t.on("beforeinput",(o,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=xm[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==Nn&&(d.selectionToRemove=e.createSelection(s[0])),c==="deleteContentBackward"&&(x.isAndroid&&(d.sequence=1),function(h){if(h.length!=1||h[0].isCollapsed)return!1;const m=h[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let k=0;for(const{nextPosition:A,item:E}of m){if(A.parent.is("$text")){const S=A.parent.data,O=A.offset;if(Qs(S,O)||Zs(S,O)||sd(S,O))continue;k++}else(E.is("containerElement")||E.is("emptyElement"))&&k++;if(k>1)return!0}return!1}(s)&&(d.unit=Nn,d.selectionToRemove=e.createSelection(s)));const u=new Di(t,"delete",s[0]);t.fire(u,new Mi(e,a,d)),u.stop.called&&o.stop()}),x.isBlink&&function(o){const r=o.view,s=r.document;let a=null,c=!1;function l(u){return u==ke.backspace||u==ke.delete}function d(u){return u==ke.backspace?Ri:Oo}s.on("keydown",(u,{keyCode:h})=>{a=h,c=!1}),s.on("keyup",(u,{keyCode:h,domEvent:m})=>{const k=s.selection,A=o.isEnabled&&h==a&&l(h)&&!k.isCollapsed&&!c;if(a=null,A){const E=k.getFirstRange(),S=new Di(s,"delete",E),O={unit:Nn,direction:d(h),selectionToRemove:k};s.fire(S,new Mi(r,m,O))}}),s.on("beforeinput",(u,{inputType:h})=>{const m=xm[h];l(a)&&m&&m.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(u,{inputType:h,data:m})=>{a==ke.delete&&h=="insertText"&&m==""&&u.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class _n extends G{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,o=e.model.document;t.addObserver(ux),this._undoOnBackspace=!1;const r=new vm(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new vm(e,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:u}=a,h=c==="forward"?"deleteForward":"delete",m={sequence:l};if(u=="selection"){const k=Array.from(d.getRanges()).map(A=>e.editing.mapper.toModelRange(A));m.selection=e.model.createSelection(k)}else m.unit=u;e.execute(h,m),t.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,e.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(o,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class hx extends G{static get requires(){return[Am,_n]}static get pluginName(){return"Typing"}}function Dm(i,e){let t=i.start;return{text:Array.from(i.getWalker({ignoreElementEnd:!1})).reduce((n,{item:o})=>o.is("$text")||o.is("$textProxy")?n+o.data:(t=e.createPositionAfter(o),""),""),range:e.createRange(t,i.end)}}class Em extends xe(){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,o=n.document.selection,r=n.createRange(n.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:a}=Dm(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(t,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${e}`,l)}}}class Tm extends G{constructor(e){super(e),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const e=this.editor,t=e.model,n=e.editing.view,o=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==ke.arrowright,l=a.keyCode==ke.arrowleft;if(!c&&!l)return;const d=o.contentLanguageDirection;let u=!1;u=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&Vt(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model,o=n.document.selection,r=o.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!An(o,t))&&!!Vt(r,t)&&(Lo(e),An(o,t)&&Vt(r,t,!0)?Po(n,t):this._overrideGravity(),!0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,o=n.document.selection,r=o.getFirstPosition();return this._isGravityOverridden?(Lo(e),this._restoreGravity(),Vt(r,t,!0)?Po(n,t):Xr(n,t,r),!0):r.isAtStart?!!An(o,t)&&(Lo(e),Xr(n,t,r),!0):!An(o,t)&&Vt(r,t,!0)?(Lo(e),Xr(n,t,r),!0):!!Mm(r,t)&&(r.isAtEnd&&!An(o,t)&&Vt(r,t)?(Lo(e),Xr(n,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(Na);let r=!1;this.listenTo(o,"mousedown",()=>{r=!0}),this.listenTo(o,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!An(n,s))return;const a=n.getFirstPosition();Vt(a,s)&&(a.isAtStart||Vt(a,s,!0)?Po(t,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,n=this.attributes;this.listenTo(e,"insertContent",()=>{const o=t.getFirstPosition();An(t,n)&&Vt(o,n)&&Po(e,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,o=e.editing.view;let r=!1,s=!1;this.listenTo(o.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=An(n,this.attributes)&&!Mm(a,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r&&(r=!1,s||e.model.enqueueChange(()=>{const a=n.getFirstPosition();An(n,this.attributes)&&Vt(a,this.attributes)&&(a.isAtStart||Vt(a,this.attributes,!0)?Po(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function An(i,e){for(const t of e)if(i.hasAttribute(t))return!0;return!1}function Xr(i,e,t){const n=t.nodeBefore;i.change(o=>{if(n){const r=[],s=i.schema.isObject(n)&&i.schema.isInline(n);for(const[a,c]of n.getAttributes())!i.schema.checkAttribute("$text",a)||s&&i.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);o.setSelectionAttribute(r)}else o.removeSelectionAttribute(e)})}function Po(i,e){i.change(t=>{t.removeSelectionAttribute(e)})}function Lo(i){i.preventDefault()}function Mm(i,e){return Vt(i.getShiftedBy(-1),e)}function Vt(i,e,t=!1){const{nodeBefore:n,nodeAfter:o}=i;for(const r of e){const s=n?n.getAttribute(r):void 0,a=o?o.getAttribute(r):void 0;if((!t||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const Im={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:ji('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:ji("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:ji("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:ji('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:ji('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:ji("'"),to:[null,"‚",null,"’"]}},Sm={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},gx=["symbols","mathematical","typography","quotes"];function mx(i){return typeof i=="string"?new RegExp(`(${Ng(i)})$`):i}function px(i){return typeof i=="string"?()=>[i]:i instanceof Array?()=>i:i}function fx(i){return(i.textNode?i.textNode:i.nodeAfter).getAttributes()}function ji(i){return new RegExp(`(^|\\s)(${i})([^${i}]*)(${i})$`)}function es(i,e,t,n){return n.createRange(Bm(i,e,t,!0,n),Bm(i,e,t,!1,n))}function Bm(i,e,t,n,o){let r=i.textNode||(n?i.nodeBefore:i.nodeAfter),s=null;for(;r&&r.getAttribute(e)==t;)s=r,r=n?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,n?"before":"after"):i}function*Nm(i,e){for(const t of e)t&&i.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class kx extends de{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,o=t.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(o.isLimit(a)||o.isLimit(c))return r||a!=c||t.deleteContent(n),!1;if(r){const l=Nm(e.model.schema,n.getAttributes());return Om(e,s.start),e.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(t.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Om(e,n.focus),!0;e.setSelection(c,0)}}return!1}}function Om(i,e){i.split(e),i.setSelection(e.parent.nextSibling,0)}const bx={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Pm extends ln{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(o,r)=>{n=r.shiftKey}),t.on("beforeinput",(o,r)=>{if(!this.isEnabled)return;let s=r.inputType;x.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=bx[s];if(!c)return;const l=new Di(t,"enter",r.targetRanges[0]);t.fire(l,new Mi(e,a,{isSoft:c.isSoft})),l.stop.called&&o.stop()})}observe(){}stopObserving(){}}class ts extends G{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document,o=this.editor.t;t.addObserver(Pm),e.commands.add("enter",new kx(e)),this.listenTo(n,"enter",(r,s)=>{n.isComposing||s.preventDefault(),s.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class wx extends de{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(o,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,u=l==d;if(a){const h=Nm(o.schema,s.getAttributes());Lm(o,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(h)}else{const h=!(c.start.isAtStart&&c.end.isAtEnd);o.deleteContent(s,{leaveUnmerged:h}),u?Lm(o,r,s.focus):h&&r.setSelection(d,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,o){if(o.rangeCount>1)return!1;const r=o.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=o.getFirstRange(),a=s.start.parent,c=s.end.parent;return!((ec(a,n)||ec(c,n))&&a!==c)}(e.schema,t.selection)}}function Lm(i,e,t){const n=e.createElement("softBreak");i.insertContent(n,t),e.setSelection(n,"after")}function ec(i,e){return!i.is("rootElement")&&(e.isLimit(i)||ec(i.parent,e))}class _x extends G{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,r=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),o.addObserver(Pm),e.commands.add("shiftEnter",new wx(e)),this.listenTo(r,"enter",(a,c)=>{r.isComposing||c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Ax extends ye(){constructor(){super(...arguments),this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const r=n[0];o===r||tc(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const r=n[0];o===r||tc(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(tc(e,t[n]))return;n>-1&&t.splice(n,1);let o=0;for(;t[o]&&Cx(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(o=>o.id===e);n>-1&&t.splice(n,1)}}function tc(i,e){return i&&e&&i.priority==e.priority&&ns(i.classes)==ns(e.classes)}function Cx(i,e){return i.priority>e.priority||!(i.priorityns(e.classes)}function ns(i){return Array.isArray(i)?i.sort().join(","):i}const vx='',yx="ck-widget",zm="ck-widget_selected";function et(i){return!!i.is("element")&&!!i.getCustomProperty("widget")}function nc(i,e,t={}){if(!i.is("containerElement"))throw new B("widget-to-widget-wrong-element-type",null,{element:i});return e.setAttribute("contenteditable","false",i),e.addClass(yx,i),e.setCustomProperty("widget",!0,i),i.getFillerOffset=Ex,e.setCustomProperty("widgetLabel",[],i),t.label&&function(n,o){n.getCustomProperty("widgetLabel").push(o)}(i,t.label),t.hasSelectionHandle&&function(n,o){const r=o.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new kn;return c.set("content",vx),c.render(),a.appendChild(c.element),a});o.insert(o.createPositionAt(n,0),r),o.addClass(["ck-widget_with-selection-handle"],n)}(i,e),Rm(i,e),i}function xx(i,e,t){if(e.classes&&t.addClass(Oe(e.classes),i),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],i)}function Dx(i,e,t){if(e.classes&&t.removeClass(Oe(e.classes),i),e.attributes)for(const n in e.attributes)t.removeAttribute(n,i)}function Rm(i,e,t=xx,n=Dx){const o=new Ax;o.on("change:top",(r,s)=>{s.oldDescriptor&&n(i,s.oldDescriptor,s.writer),s.newDescriptor&&t(i,s.newDescriptor,s.writer)}),e.setCustomProperty("addHighlight",(r,s,a)=>o.add(s,a),i),e.setCustomProperty("removeHighlight",(r,s,a)=>o.remove(s,a),i)}function jm(i,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],i),e.setAttribute("role","textbox",i),e.setAttribute("tabindex","-1",i),t.label&&e.setAttribute("aria-label",t.label,i),e.setAttribute("contenteditable",i.isReadOnly?"false":"true",i),i.on("change:isReadOnly",(n,o,r)=>{e.setAttribute("contenteditable",r?"false":"true",i)}),i.on("change:isFocused",(n,o,r)=>{r?e.addClass("ck-editor__nested-editable_focused",i):e.removeClass("ck-editor__nested-editable_focused",i)}),Rm(i,e),i}function Fm(i,e){const t=i.getSelectedElement();if(t){const n=On(i);if(n)return e.createRange(e.createPositionAt(t,n))}return e.schema.findOptimalInsertionRange(i)}function Ex(){return null}const Cn="widget-type-around";function ti(i,e,t){return!!i&&et(i)&&!t.isInline(e)}function On(i){return i.getAttribute(Cn)}var Vm=I(8508),Tx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Vm.A,Tx),Vm.A.locals;const Hm=["before","after"],Mx=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Um="ck-widget__type-around_disabled";class Ix extends G{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[ts,_n]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,o,r)=>{t.change(s=>{for(const a of t.document.roots)r?s.removeClass(Um,a):s.addClass(Um,a)}),r||e.model.change(s=>{s.removeSelectionAttribute(Cn)})}),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(e,t){const n=this.editor,o=n.editing.view,r=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:r}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,n,o){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=On(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,o={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&ti(c,s.item,t)&&(function(l,d,u){const h=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(m){const k=this.toDomElement(m);return function(A,E){for(const S of Hm){const O=new Gt({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${S}`],title:E[S],"aria-hidden":"true"},children:[A.ownerDocument.importNode(Mx,!0)]});A.appendChild(O.render())}}(k,d),function(A){const E=new Gt({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});A.appendChild(E.render())}(k),k});l.insert(l.createPositionAt(u,"end"),h)}(a.writer,o,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 e=this.editor,t=e.model,n=t.document.selection,o=t.schema,r=e.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:[et,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&e.model.change(l=>{l.removeSelectionAttribute(Cn)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const a=n.getSelectedElement();a&&ti(e.editing.mapper.toViewElement(a),a,o)||e.model.change(c=>{c.removeSelectionAttribute(Cn)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const k=l.mapper.toViewElement(this._currentFakeCaretModelElement);k&&(d.removeClass(Hm.map(s),k),this._currentFakeCaretModelElement=null)}const u=c.selection.getSelectedElement();if(!u)return;const h=l.mapper.toViewElement(u);if(!ti(h,u,o))return;const m=On(c.selection);m&&(d.addClass(s(m),h),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||e.model.change(d=>{d.removeSelectionAttribute(Cn)})})}_handleArrowKeyPress(e,t){const n=this.editor,o=n.model,r=o.document.selection,s=o.schema,a=n.editing.view,c=function(u,h){const m=qs(u,h);return m==="down"||m==="right"}(t.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;ti(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=On(t.document.selection);return t.change(o=>n?n!==(e?"after":"before")?(o.removeSelectionAttribute(Cn),!0):!1:(o.setSelectionAttribute(Cn,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,o=n.schema,r=t.plugins.get("Widget"),s=r._getObjectElementNextToSelection(e);return!!ti(t.editing.mapper.toViewElement(s),s,o)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Cn,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,o=n.schema,r=t.editing.mapper,s=n.document.selection,a=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!ti(r.toViewElement(a),a,o)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(Cn,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,o)=>{const r=o.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 u=l.closest(".ck-widget");return d.mapDomToView(u)}(r,t.domConverter),c=e.editing.mapper.toModelElement(a);this._insertParagraph(c,s),o.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(o,r)=>{if(o.eventPhase!="atTarget")return;const s=t.getSelectedElement(),a=e.editing.mapper.toViewElement(s),c=e.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:ti(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),o.stop())},{context:et})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=e.selection)},{priority:"high"}),x.isAndroid?this._listenToIfEnabled(e,"keydown",(t,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,o=n.schema;this._listenToIfEnabled(t.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=On(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)e.execute("delete",{selection:n.createSelection(l,"on")});else{const u=o.getNearestSelectionRange(n.createPositionAt(l,a),c);if(u)if(u.isCollapsed){const h=n.createSelection(u.start);if(n.modifySelection(h,{direction:c}),h.focus.isEqual(u.start)){const m=function(k,A){let E=A;for(const S of A.getAncestors({parentFirst:!0})){if(S.childCount>1||k.isLimit(S))break;E=S}return E}(o,u.start.parent);n.deleteContent(n.createSelection(m,"on"),{doNotAutoparagraph:!0})}else n.change(m=>{m.setSelection(u),e.execute(d?"deleteForward":"delete")})}else n.change(h=>{h.setSelection(u),e.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:et})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=On(n);return a?(o.stop(),t.change(c=>{const l=n.getSelectedElement(),d=t.createPositionAt(l,a),u=c.createSelection(d),h=t.insertContent(r,u);return c.setSelection(u),h})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(n,o)=>{const[,r,s={}]=o;if(r&&!r.is("documentSelection"))return;const a=On(t);a&&(s.findOptimalPosition=a,o[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[o])=>{o&&!o.is("documentSelection")||On(t)&&n.stop()},{priority:"high"})}}function Sx(i){const e=i.model;return(t,n)=>{const o=n.keyCode==ke.arrowup,r=n.keyCode==ke.arrowdown,s=n.shiftKey,a=e.document.selection;if(!o&&!r)return;const c=r;if(s&&function(d,u){return!d.isCollapsed&&d.isBackward==u}(a,c))return;const l=function(d,u,h){const m=d.model;if(h){const k=u.isCollapsed?u.focus:u.getLastPosition(),A=Wm(m,k,"forward");if(!A)return null;const E=m.createRange(k,A),S=qm(m.schema,E,"backward");return S?m.createRange(k,S):null}{const k=u.isCollapsed?u.focus:u.getFirstPosition(),A=Wm(m,k,"backward");if(!A)return null;const E=m.createRange(A,k),S=qm(m.schema,E,"forward");return S?m.createRange(S,k):null}}(i,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,u,h){const m=d.model,k=d.view.domConverter;if(h){const z=m.createSelection(u.start);m.modifySelection(z),z.focus.isAtEnd||u.start.isEqual(z.focus)||(u=m.createRange(z.focus,u.end))}const A=d.mapper.toViewRange(u),E=k.viewRangeToDom(A),S=ge.getDomRangeRects(E);let O;for(const z of S)if(O!==void 0){if(Math.round(z.top)>=O)return!1;O=Math.max(O,Math.round(z.bottom))}else O=Math.round(z.bottom);return!0}(i,l,c))&&(e.change(d=>{const u=c?l.end:l.start;if(s){const h=e.createSelection(a.anchor);h.setFocus(u),d.setSelection(h)}else d.setSelection(u)}),t.stop(),n.preventDefault(),n.stopPropagation())}}}function Wm(i,e,t){const n=i.schema,o=i.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of o.getWalker({startPosition:e,direction:t})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function qm(i,e,t){const n=t=="backward"?e.end:e.start;if(i.checkChild(n,"$text"))return n;for(const{nextPosition:o}of e.getWalker({direction:t}))if(i.checkChild(o,"$text"))return o;return null}var Gm=I(695),Bx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Gm.A,Bx),Gm.A.locals;class zo extends G{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[Ix,_n]}init(){const e=this.editor,t=e.editing.view,n=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{const c=a.writer,l=s.selection;if(l.isCollapsed)return;const d=l.getSelectedElement();if(!d)return;const u=e.editing.mapper.toViewElement(d);var h;et(u)&&a.consumable.consume(l,"selection")&&c.setSelection(c.createRangeOn(u),{fake:!0,label:(h=u,h.getCustomProperty("widgetLabel").reduce((m,k)=>typeof k=="function"?m?m+". "+k():k():m?m+". "+k:k,""))})}),this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,l=c.document.selection;let d=null;for(const u of l.getRanges())for(const h of u){const m=h.item;et(m)&&!Nx(m,d)&&(c.addClass(zm,m),this._previouslySelected.add(m),d=m)}},{priority:"low"}),t.addObserver(Na),this.listenTo(n,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(n,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[et,"$text"]}),this.listenTo(n,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(n,"arrowKey",Sx(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(r,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),r.stop())},{context:"$root"}),this.listenTo(n,"tab",(r,s)=>{r.eventPhase=="atTarget"&&(s.shiftKey||this._selectFirstNestedEditable()&&(s.preventDefault(),r.stop()))},{context:et,priority:"low"}),this.listenTo(n,"tab",(r,s)=>{s.shiftKey&&this._selectAncestorWidget()&&(s.preventDefault(),r.stop())},{priority:"low"}),this.listenTo(n,"keydown",(r,s)=>{s.keystroke==ke.esc&&this._selectAncestorWidget()&&(s.preventDefault(),r.stop())},{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const n=this.editor,o=n.editing.view,r=o.document;let s=t.target;if(t.domEvent.detail>=3)return void(this._selectBlockContent(s)&&t.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(et(l))return!1;l=l.parent}return!1}(s)||!et(s)&&(s=s.findAncestor(et),!s))return;x.isAndroid&&t.preventDefault(),r.isFocused||o.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(e){const t=this.editor,n=t.model,o=t.editing.mapper,r=n.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,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}(o.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(h,m){const k=new gn({startPosition:h});for(const{item:A}of k){if(m.isLimit(A)||!A.is("element"))return null;if(m.checkChild(A,"$text"))return A}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),u=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,u))}),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,o=this.editor.model,r=o.schema,s=o.document.selection,a=s.getSelectedElement(),c=qs(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const h=l?s.getLastPosition():s.getFirstPosition(),m=r.getNearestSelectionRange(h,l?"forward":"backward");return void(m&&(o.change(k=>{k.setSelection(m)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const h=s.getFirstPosition(),m=s.getLastPosition(),k=h.nodeAfter,A=m.nodeBefore;return void((k&&r.isObject(k)||A&&r.isObject(A))&&(o.change(E=>{E.setSelection(l?m:h)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const u=this._getObjectElementNextToSelection(l);if(u&&r.isObject(u)){if(r.isInline(u)&&d)return;this._setSelectionOverElement(u),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,o=n.schema,r=n.document.selection.getSelectedElement();r&&o.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(o=>{let r=t.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,o.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,r=t.createSelection(o);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(o))return null;const s=e?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(zm,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,t=this.editor.editing.view.document;for(const n of t.selection.getFirstRange().getItems())if(n.is("editableElement")){const o=e.editing.mapper.toModelElement(n);if(!o)continue;const r=e.model.createPositionAt(o,0),s=e.model.schema.getNearestSelectionRange(r,"forward");return e.model.change(a=>{a.setSelection(s)}),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,n=e.editing.view.document.selection.getFirstPosition().parent,o=(n.is("$text")?n.parent:n).findAncestor(et);if(!o)return!1;const r=t.toModelElement(o);return!!r&&(e.model.change(s=>{s.setSelection(r,"on")}),!0)}}function Nx(i,e){return!!e&&Array.from(i.getAncestors()).includes(e)}class is extends G{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Yr]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(o){const r=o.getSelectedElement();return!(!r||!et(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:o,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void X("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,c=new ja(s.locale);if(c.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new B("widget-toolbar-duplicated",this,{toolbarId:e});const l={view:c,getRelatedElement:o,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=o(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(e,l)}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const o of this._toolbarDefinitions.values()){const r=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>e&&(e=s,t=r,n=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?$m(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Km(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const o=n.getRelatedElement(this.editor.editing.view.document.selection);$m(this.editor,o)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function $m(i,e){const t=i.plugins.get("ContextualBalloon"),n=Km(i,e);t.updatePosition(n)}function Km(i,e){const t=i.editing.view,n=wt.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Ym=I(4095),Ox={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Ym.A,Ox),Ym.A.locals;const ic=Ci("px");class Px extends te{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",t=>!t)],style:{left:e.to("left",t=>ic(t)),top:e.to("top",t=>ic(t)),width:e.to("width",t=>ic(t))}}})}}class os extends G{constructor(){super(...arguments),this.removeDropMarkerDelayed=Ys(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=$r(e=>this._updateDropMarker(e),40),this._reconvertMarkerThrottled=$r(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new Px,this._domEmitter=new(Lt()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,n,o,r,s){this.removeDropMarkerDelayed.cancel();const a=Qm(this.editor,e,t,n,o,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(e,t,n,o,r,s){const a=Qm(this.editor,e,t,n,o,r,s);return this.removeDropMarker(),a}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(o=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||o.updateMarker("drop-target",{range:e}):o.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(t){const n=this.toDomElement(t);return n.append("⁠",t.createElement("span"),"⁠"),n})}_updateDropTargetLine(e){const t=this.editor.editing,n=e.start.nodeBefore,o=e.start.nodeAfter,r=e.start.parent,s=n?t.mapper.toViewElement(n):null,a=s?t.view.domConverter.mapViewToDom(s):null,c=o?t.mapper.toViewElement(o):null,l=c?t.view.domConverter.mapViewToDom(c):null,d=t.mapper.toViewElement(r);if(!d)return;const u=t.view.domConverter.mapViewToDom(d),h=this._getScrollableRect(d),{scrollX:m,scrollY:k}=w.window,A=a?new ge(a):null,E=l?new ge(l):null,S=new ge(u).excludeScrollbarsAndBorders(),O=A?A.bottom:S.top,z=E?E.top:S.bottom,H=w.window.getComputedStyle(u),Q=O<=z?(O+z)/2:z;if(h.topa.schema.checkChild(u,h))){if(a.schema.checkChild(u,"$text"))return a.createRange(u);if(d)return rs(i,Jm(i,d.parent),n,o)}}}else if(a.schema.isInline(l))return rs(i,l,n,o)}if(a.schema.isBlock(l))return rs(i,l,n,o);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(m=>m.is("element")&&!Lx(i,m));let u=0,h=d.length;if(h==0)return a.createRange(a.createPositionAt(l,"end"));for(;ue in i?zx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class Hx extends G{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(Lt())}static get pluginName(){return"DragDropBlockToolbar"}init(){const e=this.editor;if(this.listenTo(e,"change:isReadOnly",(t,n,o)=>{o?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),x.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",(n,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(w.document,"dragover",(n,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(w.document,"drop",(n,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(w.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",(n,o,r)=>{t.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,n=t.document.selection,o=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));t.change(a=>a.setSelection(s)),this._isBlockDragging=!0,o.focus(),o.getObserver(Bo).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=e.clientY,o=document.elementFromPoint(t,n),r=this.editor.editing.view;var s,a;o&&o.closest(".ck-editor__editable")&&r.getObserver(Bo).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))Fx.call(l,d)&&ep(c,d,l[d]);if(Xm)for(var d of Xm(l))Vx.call(l,d)&&ep(c,d,l[d]);return c})({},e),a={type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:n,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()},Rx(s,jx(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var tp=I(7793),Ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(tp.A,Ux),tp.A.locals;class Wx extends G{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=Ys(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(Lt())}static get pluginName(){return"DragDrop"}static get requires(){return[Ft,zo,os,Hx]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Bo),t.addObserver(Na),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,o,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,o,r)=>{r||this._finalizeDragging(!1)}),x.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 e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=e.plugins.get(os);this.listenTo(o,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=$(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:u}=a,{clientX:h}=u;this._updatePreview({dataTransfer:l,domTarget:d,clientX:h}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(w.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(o,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(o,"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"),x.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 e=this.editor,t=e.editing.view.document,n=e.plugins.get(os);this.listenTo(t,"clipboardInput",(o,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 o.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),np(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void o.stop();r.targetRanges=[e.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Ft);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(o))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=np(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&o)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(o,r)=>{if(x.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=ip(r.target);if(x.isBlink&&!e.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&et(a)||(s=n.selection.editableElement)}s&&(t.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{x.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){const t=this.editor,n=t.model;t.plugins.get(os).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&n.change(o=>{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")&&o.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,n=t.model,o=n.document.selection,r=e?ip(e):null;if(r){const l=t.editing.mapper.toModelElement(r);this._draggedRange=Tt.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const s=Array.from(o.getSelectedBlocks()),a=o.getFirstRange();if(s.length==0)return void(this._draggedRange=Tt.fromRange(a));const c=op(n,s);if(s.length>1)this._draggedRange=Tt.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=Tt.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:t,clientX:n}){const o=this.editor.editing.view,r=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(r),a=w.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Pt(w.document,"div",{style:"position: fixed; left: -999999px;"}),w.document.body.appendChild(this._previewContainer));const c=new ge(s);if(s.contains(t))return;const l=parseFloat(a.paddingLeft),d=Pt(w.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,x.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=e.getData("text/html"),e.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function np(i){return x.isGecko?i.dropEffect:["all","copyMove"].includes(i.effectAllowed)?"move":"copy"}function ip(i){if(i.is("editableElement"))return null;if(i.hasClass("ck-widget__selection-handle"))return i.findAncestor(et);if(et(i))return i;const e=i.findAncestor(t=>et(t)||t.is("editableElement"));return et(e)?e:null}function op(i,e){const t=e[0],n=e[e.length-1],o=t.getCommonAncestor(n),r=i.createPositionBefore(t),s=i.createPositionAfter(n);if(o&&o.is("element")&&!i.schema.isLimit(o)){const a=i.createRangeOn(o),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return op(i,[o])}return i.createRange(r,s)}class qx extends G{static get pluginName(){return"PastePlainText"}static get requires(){return[Ft]}init(){const e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=t.document.selection;let s=!1;n.addObserver(Bo),this.listenTo(o,"keydown",(a,c)=>{s=c.shiftKey}),e.plugins.get(Ft).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const u=l.getChild(0);return d.isObject(u)?!1:Array.from(u.getAttributeKeys()).length==0}(c.content,t.schema))&&t.change(l=>{const d=Array.from(r.getAttributes()).filter(([h])=>t.schema.getAttributeProperties(h).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const u=l.createRangeIn(c.content);for(const h of u.getItems())h.is("$textProxy")&&l.setAttributes(d,h)})})}}class rp extends G{static get pluginName(){return"Clipboard"}static get requires(){return[No,Ft,Wx,qx]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Gx extends de{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!sp(e.schema,n))do if(n=n.parent,!n)return;while(!sp(e.schema,n));e.change(o=>{o.setSelection(n,"in")})}}function sp(i,e){return i.isLimit(e)&&(i.checkChild(e,"$text")||i.checkChild(e,"paragraph"))}const $x=go("Ctrl+A");class Kx extends G{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.t,n=e.editing.view.document;e.commands.add("selectAll",new Gx(e)),this.listenTo(n,"keydown",(o,r)=>{vi(r)===$x&&(e.execute("selectAll"),r.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Yx extends G{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const t=this._createButton(Ae);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("selectAll"),r=new e(t.locale),s=n.t;return r.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),r}}class Qx extends G{static get requires(){return[Kx,Yx]}static get pluginName(){return"SelectAll"}}var Zx=Object.defineProperty,ap=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,cp=(i,e,t)=>e in i?Zx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class lp extends de{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))Jx.call(s,a)&&cp(r,a,s[a]);if(ap)for(var a of ap(s))Xx.call(s,a)&&cp(r,a,s[a]);return r})({},n[1]);const o=n[1];o.batchType||(o.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const o=this.editor.model,r=o.document,s=[],a=e.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(u=>u.root!=r.graveyard).filter(u=>!t2(u,c));d.length&&(e2(d),s.push(d[0]))}s.length&&o.change(l=>{l.setSelection(s,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(o.history.getOperations(a)),l=OC([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const u=d.affectedSelectable;u&&!n.canEditAt(u)&&(d=new tt(d.baseVersion)),t.addOperation(d),n.applyOperation(d),o.history.setOperationAsUndone(s,d)}}}}function e2(i){i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et!==i&&t.containsRange(i,!0))}class n2 extends lp{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);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,o),this.refresh()}}class i2 extends lp{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.refresh()}}class o2 extends G{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const e=this.editor,t=e.t;this._undoCommand=new n2(e),this._redoCommand=new i2(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(n,o)=>{const r=o[0];if(!r.isDocumentOperation)return;const s=r.batch,a=this._redoCommand.createdBatches.has(s),c=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(a?this._undoCommand.addBatch(s):c||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(n,o,r)=>{this._redoCommand.addBatch(r)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class r2 extends G{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?oe.undo:oe.redo,r=t.uiLanguageDirection=="ltr"?oe.redo:oe.undo;this._addButtonsToFactory("undo",n("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",n("Redo"),"CTRL+Y",r)}_addButtonsToFactory(e,t,n,o){const r=this.editor;r.ui.componentFactory.add(e,()=>{const s=this._createButton(Ae,e,t,n,o);return s.set({tooltip:!0}),s}),r.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(It,e,t,n,o))}_createButton(e,t,n,o,r){const s=this.editor,a=s.locale,c=s.commands.get(t),l=new e(a);return l.set({label:n,icon:r,keystroke:o}),l.bind("isEnabled").to(c,"isEnabled"),this.listenTo(l,"execute",()=>{s.execute(t),s.editing.view.focus()}),l}}class dp extends G{static get requires(){return[o2,r2]}static get pluginName(){return"Undo"}}class s2 extends xe(){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,o)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class Jt extends G{constructor(){super(...arguments),this.loaders=new qt,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[xh]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return X("filerepository-no-upload-adapter"),null;const t=new up(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const o of this.loaders)n+=o.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const o of this.loaders)o.uploadTotal&&(n+=o.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof up?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,o)=>{n===t&&this._loadersMap.delete(o)})}_updatePendingAction(){const e=this.editor.plugins.get(xh);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=o=>`${t("Upload in progress")} ${parseInt(o)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}class up extends xe(){constructor(e,t){super(),this.id=$(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new s2,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,o)=>o?n/o*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new B("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new B("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="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(e){const t={};return t.promise=new Promise((n,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,o(r)})}),t}}const hp="ckCsrfToken",gp="abcdefghijklmnopqrstuvwxyz0123456789";function a2(){let i=function(n){n=n.toLowerCase();const o=document.cookie.split(";");for(const r of o){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(hp);var e,t;return i&&i.length==40||(i=function(n){let o="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return o}(40),e=hp,t=i,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),i}class c2{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const o=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;o.addEventListener("error",()=>t(s)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const a=o.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:s);e({default:a.url})}),o.upload&&o.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",a2()),this.xhr.send(t)}}function Pn(i,e,t,n){let o,r=null;typeof n=="function"?o=n:(r=i.commands.get(n),o=()=>{i.execute(n)}),i.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const c=at(i.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(i.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const u=d.position.parent;if(u.is("element","codeBlock")||u.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const h=u.getChild(0),m=i.model.createRangeOn(h);if(!m.containsRange(c)&&!c.end.isEqual(m.end))return;const k=t.exec(h.data.substr(0,c.end.offset));k&&i.model.enqueueChange(A=>{const E=A.createPositionAt(u,0),S=A.createPositionAt(u,k[0].length),O=new Tt(E,S);if(o({match:k})!==!1){A.remove(O);const z=i.model.document.selection.getFirstRange(),H=A.createRangeIn(u);!u.isEmpty||H.isEqual(z)||H.containsRange(z,!0)||A.remove(u)}O.detach(),i.model.enqueueChange(()=>{i.plugins.get("Delete").requestUndoOnBackspace()})})})}function Fi(i,e,t,n){let o,r;t instanceof RegExp?o=t:r=t,r=r||(s=>{let a;const c=[],l=[];for(;(a=o.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:u,2:h,3:m}=a;const k=u+h+m;d+=a[0].length-k.length;const A=[d,d+u.length],E=[d+u.length+h.length,d+u.length+h.length+m.length];c.push(A),c.push(E),l.push([d+u.length,d+u.length+h.length])}return{remove:c,format:l}}),i.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!e.isEnabled)return;const c=i.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),u=d[0];if(d.length!=1||u.type!=="insert"||u.name!="$text"||u.length!=1)return;const h=l.focus,m=h.parent,{text:k,range:A}=function(z,H){let Q=z.start;return{text:Array.from(z.getItems()).reduce((se,Pe)=>!Pe.is("$text")&&!Pe.is("$textProxy")||Pe.getAttribute("code")?(Q=H.createPositionAfter(Pe),""):se+Pe.data,""),range:H.createRange(Q,z.end)}}(c.createRange(c.createPositionAt(m,0),h),c),E=r(k),S=mp(A.start,E.format,c),O=mp(A.start,E.remove,c);S.length&&O.length&&c.enqueueChange(z=>{if(n(z,S)!==!1){for(const H of O.reverse())z.remove(H);c.enqueueChange(()=>{i.plugins.get("Delete").requestUndoOnBackspace()})}})})}function mp(i,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(i.getShiftedBy(n[0]),i.getShiftedBy(n[1])))}function ss(i,e){return(t,n)=>{if(!i.commands.get(e).isEnabled)return!1;const o=i.model.schema.getValidRanges(n,e);for(const r of o)t.setAttribute(e,!0,r);t.removeSelectionAttribute(e)}}class pp extends de{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)o?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)o?r.setAttribute(this.attributeKey,o,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const o of n.getRanges())for(const r of o.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const Vi="bold";class l2 extends G{static get pluginName(){return"BoldEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vi}),e.model.schema.setAttributeProperties(Vi,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Vi,view:"strong",upcastAlso:["b",n=>{const o=n.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Vi,new pp(e,Vi)),e.keystrokes.set("CTRL+B",Vi),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function fp({editor:i,commandName:e,plugin:t,icon:n,label:o,keystroke:r}){return s=>{const a=i.commands.get(e),c=new s(i.locale);return c.set({label:o,icon:n,keystroke:r,isToggleable:!0}),c.bind("isEnabled").to(a,"isEnabled"),t.listenTo(c,"execute",()=>{i.execute(e),i.editing.view.focus()}),c}}const as="bold";class d2 extends G{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.locale.t,n=e.commands.get(as),o=fp({editor:e,commandName:as,plugin:this,icon:oe.bold,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(as,()=>{const r=o(Ae);return r.set({tooltip:!0}),r.bind("isOn").to(n,"value"),r}),e.ui.componentFactory.add("menuBar:"+as,()=>o(It))}}var kp=I(4199),u2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(kp.A,u2),kp.A.locals;const Hi="italic";class h2 extends G{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Hi}),e.model.schema.setAttributeProperties(Hi,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Hi,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Hi,new pp(e,Hi)),e.keystrokes.set("CTRL+I",Hi),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const cs="italic";class g2 extends G{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.commands.get(cs),n=e.locale.t,o=fp({editor:e,commandName:cs,plugin:this,icon:'',keystroke:"CTRL+I",label:n("Italic")});e.ui.componentFactory.add(cs,()=>{const r=o(Ae);return r.set({tooltip:!0}),r.bind("isOn").to(t,"value"),r}),e.ui.componentFactory.add("menuBar:"+cs,()=>o(It))}}class m2 extends de{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,o=t.document.selection,r=Array.from(o.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(a=>{if(s){const c=r.filter(l=>ls(l)||wp(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(ls))})}_getValue(){const e=at(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!ls(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=at(e.getSelectedBlocks());return!!n&&wp(t,n)}_removeQuote(e,t){bp(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const o=e.createPositionAfter(n.end.parent);e.move(n,o)})}_applyQuote(e,t){const n=[];bp(e,t).reverse().forEach(o=>{let r=ls(o.start);r||(r=e.createElement("blockQuote"),e.wrap(o,r)),n.push(r)}),n.reverse().reduce((o,r)=>o.nextSibling==r?(e.merge(e.createPositionAfter(o)),o):r)}}function ls(i){return i.parent.name=="blockQuote"?i.parent:null}function bp(i,e){let t,n=0;const o=[];for(;n{const a=e.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")&&!t.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const u of d.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!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,o=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!o.isCollapsed||!r.value||o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!o.isCollapsed||!r.value)return;const c=o.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var _p=I(8708),f2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(_p.A,f2),_p.A.locals;class k2 extends G{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.commands.get("blockQuote");e.ui.componentFactory.add("blockQuote",()=>{const n=this._createButton(Ae);return n.set({tooltip:!0}),n.bind("isOn").to(t,"value"),n}),e.ui.componentFactory.add("menuBar:blockQuote",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("blockQuote"),r=new e(t.locale),s=n.t;return r.set({label:s("Block quote"),icon:oe.quote,isToggleable:!0}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r}}class b2 extends G{static get pluginName(){return"CKBoxUI"}afterInit(){const e=this.editor;if(!e.commands.get("ckbox"))return;const t=e.t,n=e.ui.componentFactory;if(n.add("ckbox",()=>{const o=this._createButton(Ae);return o.tooltip=!0,o}),n.add("menuBar:ckbox",()=>this._createButton(It)),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckbox"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=oe.imageAssetManager,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=oe.imageAssetManager,r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=t.locale,o=new e(n),r=t.commands.get("ckbox"),s=n.t;return o.set({label:s("Open file manager"),icon:oe.browseFiles}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",()=>{t.execute("ckbox")}),o}}var w2=["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","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Ro=i=>{let e=0;for(let t=0;t{let e=i/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},rc=i=>{let e=Math.max(0,Math.min(1,i));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},sc=(i,e)=>(t=>t<0?-1:1)(i)*Math.pow(Math.abs(i),e),Ap=class extends Error{constructor(i){super(i),this.name="ValidationError",this.message=i}},_2=i=>{if(!i||i.length<6)throw new Ap("The blurhash string must be at least 6 characters");let e=Ro(i[0]),t=Math.floor(e/9)+1,n=e%9+1;if(i.length!==4+2*n*t)throw new Ap(`blurhash length mismatch: length is ${i.length} but it should be ${4+2*n*t}`)},A2=i=>{let e=i>>8&255,t=255&i;return[oc(i>>16),oc(e),oc(t)]},C2=(i,e)=>{let t=Math.floor(i/361),n=Math.floor(i/19)%19,o=i%19;return[sc((t-9)/9,2)*e,sc((n-9)/9,2)*e,sc((o-9)/9,2)*e]},v2=(i,e,t,n)=>{_2(i),n|=1;let o=Ro(i[0]),r=Math.floor(o/9)+1,s=o%9+1,a=(Ro(i[1])+1)/166,c=new Array(s*r);for(let u=0;ue in i?y2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;function yp(i){const e=[];let t=0;for(const o in i){const r=parseInt(o,10);isNaN(r)||(r>t&&(t=r),e.push(`${i[o]} ${o}w`))}const n=[{srcset:e.join(","),sizes:`(max-width: ${t}px) 100vw, ${t}px`,type:"image/webp"}];return{imageFallbackUrl:i.default,imageSources:n}}const jo=32;function xp({url:i,method:e="GET",data:t,onUploadProgress:n,signal:o,authorization:r}){const s=new XMLHttpRequest;s.open(e,i.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{o.throwIfAborted(),o.addEventListener("abort",a),s.addEventListener("loadstart",()=>{o.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{o.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(t)})}const E2={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function T2(i,e){return t=this,n=null,o=function*(){try{const r=yield fetch(i,((s,a)=>{for(var c in a||(a={}))x2.call(a,c)&&vp(s,c,a[c]);if(Cp)for(var c of Cp(a))D2.call(a,c)&&vp(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},e));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(o.next(d))}catch(u){s(u)}},c=d=>{try{l(o.throw(d))}catch(u){s(u)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((o=o.apply(t,n)).next())});var t,n,o}var M2=Object.defineProperty,Dp=Object.getOwnPropertySymbols,I2=Object.prototype.hasOwnProperty,S2=Object.prototype.propertyIsEnumerable,Ep=(i,e,t)=>e in i?M2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Tp=(i,e)=>{for(var t in e||(e={}))I2.call(e,t)&&Ep(i,t,e[t]);if(Dp)for(var t of Dp(e))S2.call(e,t)&&Ep(i,t,e[t]);return i};class B2 extends de{constructor(e){super(e),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 e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");return!(!e.isEnabled&&!t.isEnabled)}_prepareOptions(){const e=this.editor.config.get("ckbox");return{theme:e.theme,language:e.language,tokenUrl:e.tokenUrl,serviceOrigin:e.serviceOrigin,forceDemoLabel:e.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:t=>this.fire("ckbox:choose",t)}}}_initListeners(){const e=this.editor,t=e.model,n=!e.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=Pt(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,e.editing.view.focus())}),this.on("ckbox:choose",(o,r)=>{if(!this.isEnabled)return;const s=e.commands.get("insertImage"),a=e.commands.get("link"),c=function({assets:d,isImageAllowed:u,isLinkAllowed:h}){return d.map(m=>function(k){const A=k.data.metadata;return A?A.width&&A.height:!1}(m)?{id:m.data.id,type:"image",attributes:N2(m)}:{id:m.data.id,type:"link",attributes:O2(m)}).filter(m=>m.type==="image"?u:h)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(t.change(d=>{for(const u of c){const h=u===c[l-1],m=l===1;this._insertAsset(u,h,d,m),n&&(setTimeout(()=>this._chosenAssets.delete(u),1e3),this._chosenAssets.add(u))}}),e.editing.view.focus())}),this.listenTo(e,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(e,t,n,o){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),e.type==="image"?this._insertImage(e):this._insertLink(e,n,o),t||n.setSelection(r.getLastPosition())}_insertImage(e){const t=this.editor,{imageFallbackUrl:n,imageSources:o,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=e.attributes;t.execute("insertImage",{source:Tp({src:n,sources:o,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(e,t,n){const o=this.editor,r=o.model,s=r.document.selection,{linkName:a,linkHref:c}=e.attributes;if(s.isCollapsed){const l=sn(s.getAttributes()),d=t.createText(a,l);if(!n){const h=s.getLastPosition(),m=h.parent;m.name==="paragraph"&&m.isEmpty||o.execute("insertParagraph",{position:h});const k=r.insertContent(d);return t.setSelection(k),void o.execute("link",c)}const u=r.insertContent(d);t.setSelection(u)}o.execute("link",c)}}function N2(i){const{imageFallbackUrl:e,imageSources:t}=yp(i.data.imageUrls),{description:n,width:o,height:r,blurHash:s}=i.data.metadata,a=function(c){if(c)try{const l=`${jo}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const u=d.getContext("2d");if(!u)return;const h=u.createImageData(jo,jo),m=v2(c,jo,jo);return h.data.set(m),u.putImageData(h,0,0),d.toDataURL()}catch{return}}(s);return Tp({imageFallbackUrl:e,imageSources:t,imageTextAlternative:n||"",imageWidth:o,imageHeight:r},a?{imagePlaceholder:a}:null)}function O2(i){return{linkName:i.data.name,linkHref:P2(i)}}function P2(i){const e=new URL(i.data.url);return e.searchParams.set("download","true"),e.toString()}var ac=(i,e,t)=>new Promise((n,o)=>{var r=c=>{try{a(t.next(c))}catch(l){o(l)}},s=c=>{try{a(t.throw(c))}catch(l){o(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((t=t.apply(i,e)).next())});class Mp extends G{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return ac(this,null,function*(){const e=this.editor,t=!!e.config.get("ckbox"),n=!!window.CKBox;if(!t&&!n)return;e.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:e.locale.uiLanguage,theme:"lark",tokenUrl:e.config.get("cloudServices.tokenUrl")});const o=e.plugins.get("CloudServices"),r=e.config.get("cloudServices.tokenUrl"),s=e.config.get("ckbox.tokenUrl");if(!s)throw new B("ckbox-plugin-missing-token-url",this);this._token=s==r?o.token:yield o.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const e=(0,this.editor.t)("Cannot access default workspace."),t=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(o,r){const[,s]=o.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,t);if(n==null)throw re("ckbox-access-default-workspace-error"),e;return n}getCategoryIdForFile(e,t){return ac(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),o=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(t),s=typeof e=="string"?(a=yield T2(e,t),E2[a]):function(d){const u=d.name,h=new RegExp("\\.(?[^.]+)$");return u.match(h).groups.ext.toLowerCase()}(e);var a;const c=yield r;if(!c)throw n;if(o){const d=Object.keys(o).find(u=>o[u].find(h=>h.toLowerCase()==s));if(d){const u=c.find(h=>h.id===d||h.name===d);if(!u)throw n;return u.id}}const l=c.find(d=>d.extensions.find(u=>u.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(e){return ac(this,null,function*(){const t=this.editor,n=this._token,{signal:o}=e,r=t.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const u=yield a(d);c.push(...u.items),l=u.totalCount-(d+50),d+=50}while(l>0);return c}catch{return o.throwIfAborted(),void re("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit",50 .toString()),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),xp({url:l,signal:o,authorization:n.value})}})}}var cc=(i,e,t)=>new Promise((n,o)=>{var r=c=>{try{a(t.next(c))}catch(l){o(l)}},s=c=>{try{a(t.throw(c))}catch(l){o(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((t=t.apply(i,e)).next())});class L2 extends G{static get requires(){return["ImageUploadEditing","ImageUploadProgress",Jt,Ip]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return cc(this,null,function*(){const e=this.editor,t=!!e.config.get("ckbox"),n=!!window.CKBox;if(!t&&!n)return;const o=e.plugins.get(Jt),r=e.plugins.get(Mp);o.createUploadAdapter=c=>new z2(c,e,r);const s=!e.config.get("ckbox.ignoreDataId"),a=e.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{e.model.change(u=>{u.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class z2{constructor(e,t,n){this.loader=e,this.token=n.getToken(),this.ckboxUtils=n,this.editor=t,this.controller=new AbortController,this.serviceOrigin=t.config.get("ckbox.serviceOrigin")}upload(){return cc(this,null,function*(){const e=this.ckboxUtils,t=this.editor.t,n=yield this.loader.file,o=yield e.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",e.getWorkspaceId()),s.append("categoryId",o),s.append("file",n),xp({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=>cc(this,null,function*(){const c=yp(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=t("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class Ip extends G{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",L2,Mp]}init(){const e=this.editor;this._shouldBeInitialised()&&(this._checkImagePlugins(),Bp()&&e.commands.add("ckbox",new B2(e)))}afterInit(){const e=this.editor;this._shouldBeInitialised()&&(e.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()))}_shouldBeInitialised(){return!!this.editor.config.get("ckbox")||Bp()}_checkImagePlugins(){const e=this.editor;e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||re("ckbox-plugin-image-feature-missing",e)}_initSchema(){const e=this.editor.model.schema;e.extend("$text",{allowAttributes:"ckboxLinkId"}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.addAttributeCheck((t,n)=>{if(!t.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const e=this.editor;e.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(o,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,o.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(u=>u.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",(o,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,o.name)){if(r.attributeOldValue){const d=Sp(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=Sp(a,r.attributeNewValue);if(r.item.is("selection")){const u=a.document.selection;a.wrap(u.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),e.conversion.for("upcast").add(n=>{n.on("element:a",(o,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),j2(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),e.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),e.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const t=e.commands.get("replaceImageSource");t&&this.listenTo(t,"cleanupImage",(n,[o,r])=>{o.removeAttribute("ckboxImageId",r)})}_initFixers(){const e=this.editor,t=e.model,n=t.document.selection;t.document.registerPostFixer(function(o){return r=>{let s=!1;const a=o.model,c=o.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 F(l.position,l.position.getShiftedBy(l.length)):l.range,u=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const h of d.getItems()){if(u&&h.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",h),s=!0;continue}const m=R2(h,c._chosenAssets);for(const k of m){const A=k.type==="image"?"ckboxImageId":"ckboxLinkId";k.id!==h.getAttribute(A)&&(r.setAttribute(A,k.id,h),s=!0)}}}return s}}(e)),t.document.registerPostFixer(function(o){return r=>!(o.hasAttribute("linkHref")||!o.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function R2(i,e){const t=i.is("element","imageInline")||i.is("element","imageBlock"),n=i.hasAttribute("linkHref");return[...e].filter(o=>o.type==="image"&&t?o.attributes.imageFallbackUrl===i.getAttribute("src"):o.type==="link"&&n?o.attributes.linkHref===i.getAttribute("linkHref"):void 0)}function Sp(i,e){const t=i.createAttributeElement("a",{"data-ckbox-resource-id":e},{priority:5});return i.setCustomProperty("link",!0,t),t}function j2(i){return!!i.is("$text")||!(!i.is("element","imageInline")&&!i.is("element","imageBlock"))}function Bp(){return!!window.CKBox}var Np=I(1866),F2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Np.A,F2),Np.A.locals;class V2 extends G{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;if(t.add("ckfinder",o=>{const r=this._createButton(Ae),s=o.t;return r.set({label:s("Insert image or file"),tooltip:!0}),r}),t.add("menuBar:ckfinder",o=>{const r=this._createButton(It),s=o.t;return r.label=s("Image or file"),r}),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckfinder"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=oe.imageAssetManager,r.bind("label").to(o,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=oe.imageAssetManager,r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=new e(t.locale),o=t.commands.get("ckfinder");return n.icon=oe.browseFiles,n.bind("isEnabled").to(o),n.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),n}}class H2 extends de{constructor(e){super(e),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if(t!="popup"&&t!="modal")throw new B("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const o=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=r=>{o&&o(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(u=>!u.isImage()),l=a.filter(u=>u.isImage());for(const u of c)e.execute("link",u.getUrl());const d=[];for(const u of l){const h=u.getUrl();d.push(h||r.request("file:getProxyUrl",{file:u}))}d.length&&Op(e,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)Op(e,[a]);else{const c=e.plugins.get("Notification"),l=e.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function Op(i,e){if(i.commands.get("insertImage").isEnabled)i.execute("insertImage",{source:e});else{const t=i.plugins.get("Notification"),n=i.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class U2 extends G{static get pluginName(){return"CKFinderEditing"}static get requires(){return[$a,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new B("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new H2(e))}}class W2 extends G{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Jt]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,o=t.uploadUrl;if(!n)return;const r=e.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,o),e.plugins.get(Jt).createUploadAdapter=s=>new q2(this._uploadGateway,s)}}class q2{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class G2 extends de{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=at(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Pp(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document,o=e.selection||n.selection;t.canEditAt(o)&&t.change(r=>{const s=o.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Pp(a,t.schema)&&r.rename(a,"paragraph")})}}function Pp(i,e){return e.checkChild(i.parent,"paragraph")&&!e.isObject(i)}class $2 extends de{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,n=e.attributes;let o=e.position;t.canEditAt(o)&&t.change(r=>{if(o=this._findPositionToInsertParagraph(o,r),!o)return;const s=r.createElement("paragraph");n&&t.schema.setAllowedAttributes(s,n,r),t.insertContent(s,o),r.setSelection(s,"in")})}_findPositionToInsertParagraph(e,t){const n=this.editor.model;if(n.schema.checkChild(e,"paragraph"))return e;const o=n.schema.findAllowedParent(e,"paragraph");if(!o)return null;const r=e.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&e.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&e.isAtStart?n.createPositionBefore(r):t.split(e,o).position}}const Lp=class extends G{static get pluginName(){return"Paragraph"}init(){const i=this.editor,e=i.model;i.commands.add("paragraph",new G2(i)),i.commands.add("insertParagraph",new $2(i)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),i.conversion.elementToElement({model:"paragraph",view:"p"}),i.conversion.for("upcast").elementToElement({model:(t,{writer:n})=>Lp.paragraphLikeElements.has(t.name)?t.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let lc=Lp;lc.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class K2 extends de{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=at(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>zp(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>zp(a,o,t.schema));for(const a of s)a.is("element",o)||r.rename(a,o)})}}function zp(i,e,t){return t.checkChild(i.parent,e)&&!t.isObject(i)}const Rp="paragraph";class Y2 extends G{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.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[lc]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)o.model!=="paragraph"&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new K2(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(o,r)=>{const s=e.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Rp)&&s.childCount===0&&r.writer.rename(s,Rp)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ee.low+1})}}var jp=I(6269),Q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(jp.A,Q2),jp.A.locals;class Z2 extends G{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.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})}(e),o=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",s=>{const a={},c=new qt,l=e.commands.get("heading"),d=e.commands.get("paragraph"),u=[l];for(const m of n){const k={type:"button",model:new Tg({label:m.title,class:m.class,role:"menuitemradio",withText:!0})};m.model==="paragraph"?(k.model.bind("isOn").to(d,"value"),k.model.set("commandName","paragraph"),u.push(d)):(k.model.bind("isOn").to(l,"value",A=>A===m.model),k.model.set({commandName:"heading",commandValue:m.model})),c.add(k),a[m.model]=m.title}const h=bn(s);return Zh(h,c,{ariaLabel:r,role:"menu"}),h.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(u,"isEnabled",(...m)=>m.some(k=>k)),h.buttonView.bind("label").to(l,"value",d,"value",(m,k)=>{const A=k?"paragraph":m;return typeof A=="boolean"?o:a[A]?a[A]:o}),h.buttonView.bind("ariaLabel").to(l,"value",d,"value",(m,k)=>{const A=k?"paragraph":m;return typeof A=="boolean"?r:a[A]?`${a[A]}, ${r}`:r}),this.listenTo(h,"execute",m=>{const{commandName:k,commandValue:A}=m.source;e.execute(k,A?{value:A}:void 0),e.editing.view.focus()}),h}),e.ui.componentFactory.add("menuBar:heading",s=>{const a=new zi(s),c=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[c],u=new Za(s);a.set({class:"ck-heading-dropdown"}),u.set({ariaLabel:t("Heading"),role:"menu"}),a.buttonView.set({label:t("Heading")}),a.panelView.children.add(u);for(const h of n){const m=new Ya(s,a),k=new It(s);m.children.add(k),u.items.add(m),k.set({label:h.title,role:"menuitemradio",class:h.class}),k.bind("ariaChecked").to(k,"isOn"),k.delegate("execute").to(a),k.on("execute",()=>{const A=h.model==="paragraph"?"paragraph":"heading";e.execute(A,{value:h.model}),e.editing.view.focus()}),h.model==="paragraph"?(k.bind("isOn").to(l,"value"),d.push(l)):k.bind("isOn").to(c,"value",A=>A===h.model)}return a.bind("isEnabled").toMany(d,"isEnabled",(...h)=>h.some(m=>m)),a})}}function Fp(i){return i.createContainerElement("figure",{class:"image"},[i.createEmptyElement("img"),i.createSlot("children")])}function Vp(i,e){const t=i.plugins.get("ImageUtils"),n=i.plugins.has("ImageInlineEditing")&&i.plugins.has("ImageBlockEditing");return r=>t.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:o(r):null;function o(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function dc(i,e){const t=at(e.getSelectedBlocks());return!t||i.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}function ds(i){return i&&i.endsWith("px")?parseInt(i):null}function Hp(i){const e=ds(i.getStyle("width")),t=ds(i.getStyle("height"));return!(!e||!t)}var J2=Object.defineProperty,Up=Object.getOwnPropertySymbols,X2=Object.prototype.hasOwnProperty,eD=Object.prototype.propertyIsEnumerable,Wp=(i,e,t)=>e in i?J2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,qp=(i,e)=>{for(var t in e||(e={}))X2.call(e,t)&&Wp(i,t,e[t]);if(Up)for(var t of Up(e))eD.call(e,t)&&Wp(i,t,e[t]);return i};const tD=/^(image|image-inline)$/;class At extends G{constructor(){super(...arguments),this._domEmitter=new(Lt())}static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null,o={}){const r=this.editor,s=r.model,a=s.document.selection,c=Gp(r,t||a,n);e=qp(qp({},Object.fromEntries(a.getAttributes())),e);for(const l in e)s.schema.checkAttribute(c,l)||delete e[l];return s.change(l=>{const{setImageSizes:d=!0}=o,u=l.createElement(c,e);return s.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:t||c=="imageInline"?void 0:"auto"}),u.parent?(d&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(n=>{const o=new w.window.Image;this._domEmitter.listenTo(o,"load",()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",o.naturalWidth,e),r.setAttribute("height",o.naturalHeight,e)}),this._domEmitter.stopListening(o,"load")}),o.src=t}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const n=e.getSelectedElement();if(n&&this.isImageWidget(n))return n;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:tD})}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if(Gp(t,n,null)=="imageBlock"){const r=function(s,a){const c=Fm(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,t.model);if(t.model.schema.checkChild(r,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),nc(e,t,{label:()=>{const o=this.findViewImgElement(e).getAttribute("alt");return o?`${o} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&et(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Gp(i,e,t){const n=i.model.schema,o=i.config.get("image.insert.type");return i.plugins.has("ImageBlockEditing")?i.plugins.has("ImageInlineEditing")?t||(o==="inline"?"imageInline":o!=="auto"?"imageBlock":e.is("selection")?dc(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class nD extends de{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),o=t.model,r=n.getClosestSelectedImageElement(o.document.selection);o.change(s=>{s.setAttribute("alt",e.newValue,r)})}}class iD extends G{static get requires(){return[At]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new nD(this.editor))}}var $p=I(4062),oD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()($p.A,oD),$p.A.locals;var Kp=I(2722),rD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Kp.A,rD),Kp.A.locals;class sD extends te{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new ct,this.keystrokes=new ft,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._focusables=new zt,this._focusCycler=new jt({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),br({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createLabeledInputView(){const e=this.locale.t,t=new Fr(this.locale,Ur);return t.label=e("Text alternative"),t}}function Yp(i){const e=i.editing.view,t=wt.defaultPositions,n=i.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.viewportStickyNorth]}}class aD extends G{static get requires(){return[Yr]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const o=e.commands.get("imageTextAlternative"),r=new Ae(n);return r.set({label:t("Change image text alternative"),icon:oe.textAlternative,tooltip:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(ea(sD))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.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",(o,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(o){const r=o.plugins.get("ContextualBalloon");if(o.plugins.get("ImageUtils").getClosestSelectedImageWidget(o.editing.view.document.selection)){const s=Yp(o);r.updatePosition(s)}}(e):this._hideForm(!0)}),kr({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Yp(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&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 Qp extends G{static get requires(){return[iD,aD]}static get pluginName(){return"ImageTextAlternative"}}function Zp(i,e){const t=(n,o,r)=>{if(!r.consumable.consume(o.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(o.item),c=i.findViewImgElement(a);o.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):o.attributeNewValue&&(s.setAttribute("srcset",o.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${e}`,t)}}function us(i,e,t){const n=(o,r,s)=>{if(!s.consumable.consume(r.item,o.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=i.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return o=>{o.on(`attribute:${t}:${e}`,n)}}class Jp extends ln{observe(e){this.listenTo(e,"load",(t,n)=>{const o=n.target;this.checkShouldIgnoreEventFromTarget(o)||o.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}var cD=Object.defineProperty,Xp=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,dD=Object.prototype.propertyIsEnumerable,ef=(i,e,t)=>e in i?cD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,hs=(i,e)=>{for(var t in e||(e={}))lD.call(e,t)&&ef(i,t,e[t]);if(Xp)for(var t of Xp(e))dD.call(e,t)&&ef(i,t,e[t]);return i};class uD extends de{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&X("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&X("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Oe(e.source),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&o.isImage(c)){const l=this.editor.model.createPositionAfter(c);o.insertImage(hs(hs({},s),r),l)}else o.insertImage(hs(hs({},s),r))})}}class hD extends de{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),n.setImageNaturalSizeAttributes(t)})}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class uc extends G{static get requires(){return[At]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(Jp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new uD(e),o=new hD(e);e.commands.add("insertImage",n),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",n)}}class tf extends G{static get requires(){return[At]}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(e){const t=this.editor,n=t.plugins.get("ImageUtils"),o=e==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${e}`,(d,u,h)=>{if(!h.consumable.consume(u.item,d.name))return;const m=h.writer,k=h.mapper.toViewElement(u.item),A=n.findViewImgElement(k);if(u.attributeNewValue!==null?m.setAttribute(c,u.attributeNewValue,A):m.removeAttribute(c,A),u.item.hasAttribute("sources"))return;const E=u.item.hasAttribute("resizedWidth");if(e==="imageInline"&&!E&&!l)return;const S=u.item.getAttribute("width"),O=u.item.getAttribute("height");S&&O&&m.setStyle("aspect-ratio",`${S}/${O}`,A)})}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:s=>Hp(s)?ds(s.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:s=>Hp(s)?ds(s.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),t.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class nf extends de{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,n=this.editor.model,o=t.plugins.get("ImageUtils"),r=o.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=e,l=Array.from(n.markers).filter(h=>h.getRange().containsItem(r)),d=o.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const u=a.createRangeOn(d);for(const h of l){const m=h.getRange(),k=m.root.rootName!="$graveyard"?m.getJoined(u,!0):u;a.updateMarker(h,{range:k})}return{oldElement:r,newElement:d}}):null}}var of=I(7378),gD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(of.A,gD),of.A.locals;class rf extends G{static get requires(){return[At]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,n=e.plugins.get("ImageUtils");t.for("editingDowncast").add(o=>{o.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 e=this.editor,t=e.model,n=e.editing,o=n.view,r=e.plugins.get("ImageUtils");o.addObserver(Jp),this.listenTo(o.document,"imageLoaded",(s,a)=>{const c=o.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")&&t.enqueueChange({isUndoable:!1},u=>{u.removeAttribute("placeholder",d)})})}}class sf extends G{static get requires(){return[uc,tf,At,rf,Ft]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new nf(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>Fp(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>o.toImageWidget(Fp(s),s,t("image widget"))}),n.for("downcast").add(us(o,"imageBlock","src")).add(us(o,"imageBlock","alt")).add(Zp(o,"imageBlock")),n.for("upcast").elementToElement({view:Vp(e,"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 u=at(l.convertItem(d,c.modelCursor).modelRange.getItems());u?(l.convertChildren(c.viewItem,u),l.updateConversionResult(u,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(o.isInlineImageView))return;l=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(l);if(dc(t.schema,d)==="imageBlock"){const u=new fn(n.document),h=c.map(m=>u.createElement("figure",{class:"image"},m));a.content=u.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&t.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(d)})})}}var af=I(3350),mD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(af.A,mD),af.A.locals;class pD extends te{constructor(e,t=[]){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt,this.children=this.createCollection(),this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of t)this.children.add(n),this._focusables.add(n),n instanceof Rv&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)fD(n)&&(n.focusCycler.on("forwardCycle",o=>{this._focusCycler.focusNext(),o.stop()}),n.focusCycler.on("backwardCycle",o=>{this._focusCycler.focusPrevious(),o.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),br({view:this});for(const t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function fD(i){return"focusCycler"in i}class cf extends G{constructor(e){super(e),this._integrations=new Map,e.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[At]}init(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=n.isImage(t.getSelectedElement())});const o=r=>this._createToolbarComponent(r);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o)}registerIntegration({name:e,observable:t,buttonViewCreator:n,formViewCreator:o,requiresForm:r}){this._integrations.has(e)&&X("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:n,formViewCreator:o,requiresForm:!!r})}_createToolbarComponent(e){const t=this.editor,n=e.t,o=this._prepareIntegrations();if(!o.length)return null;let r;const s=o[0];if(o.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new Hr(e,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=bn(e,r),c=o.map(({observable:l})=>typeof l=="function"?l():l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=o.map(({formViewCreator:u})=>u(o.length==1)),d=new pD(t.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return X("image-insert-integrations-not-specified"),t;for(const n of e)this._integrations.has(n)?t.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||X("image-insert-unknown-integration",{item:n});return t.length||X("image-insert-integrations-not-registered"),t}}var lf=I(265),kD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(lf.A,kD),lf.A.locals;class bD extends G{static get requires(){return[sf,zo,Qp,cf]}static get pluginName(){return"ImageBlock"}}class wD extends G{static get requires(){return[uc,tf,At,rf,Ft]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,o)=>{if(n.endsWith("caption")&&o.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new nf(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.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})=>o.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,t("image widget"))}),n.for("downcast").add(us(o,"imageInline","src")).add(us(o,"imageInline","alt")).add(Zp(o,"imageInline")),n.for("upcast").elementToElement({view:Vp(e,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(o.isBlockImageView))return;l=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(l);if(dc(t.schema,d)==="imageInline"){const u=new fn(n.document),h=c.map(m=>m.childCount===1?(Array.from(m.getAttributes()).forEach(k=>u.setAttribute(...k,o.findViewImgElement(m))),m.getChild(0)):m);a.content=u.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&t.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&o.setImageNaturalSizeAttributes(d)})})}}class _D extends G{static get requires(){return[wD,zo,Qp,cf]}static get pluginName(){return"ImageInline"}}class df extends G{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[At]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),n=e.getFirstPosition().findAncestor("caption");return n&&t.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&t.isBlockImageView(e.parent)?{name:!0}:null}}class AD extends de{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),n=e.plugins.get("ImageUtils");if(!e.plugins.has(sf))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,r=o.getSelectedElement();if(!r){const s=t.getCaptionFromModelSelection(o);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(r):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=o._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||e.createElement("caption");e.append(c,s),t&&e.setSelection(c,"in")}_hideImageCaption(e){const t=this.editor,n=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),o._saveCaption(a,s),e.setSelection(a,"on"),e.remove(s)}}class CD extends G{constructor(e){super(e),this._savedCaptionsMap=new WeakMap}static get requires(){return[At,df]}static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new AD(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),r=e.t;e.conversion.for("upcast").elementToElement({view:s=>o.matchImageCaptionViewElement(s),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),e.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"),Dd({view:t,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return jm(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),r=e.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(t.isBlockImage(c)){const u=n.getCaptionFromImageModelElement(c);if(u)return void this._saveCaption(l,u)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};o&&this.listenTo(o,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Te.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{const r=t.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=o.getCaptionFromImageModelElement(a);if(!c)return;e.editing.reconvertItem(c)}}})}}class vD extends G{static get requires(){return[df]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",r=>{const s=e.commands.get("toggleImageCaption"),a=new Ae(r);return a.set({icon:oe.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>o(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(e.model.document.selection);if(c){const l=e.editing.mapper.toViewElement(c);t.scrollToTheSelection(),t.change(d=>{d.addClass("image__caption_highlighted",l)})}e.editing.view.focus()}),a})}}var uf=I(5247),yD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(uf.A,yD),uf.A.locals;function hf(i){const e=i.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function xD(i){return new Promise((e,t)=>{const n=i.getAttribute("src");fetch(n).then(o=>o.blob()).then(o=>{const r=gf(o,n),s=r.replace("image/",""),a=new File([o],`image.${s}`,{type:r});e(a)}).catch(o=>o&&o.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=w.document.createElement("img");l.addEventListener("load",()=>{const d=w.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(u=>u?a(u):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=gf(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(e).catch(t):t(o))})}function gf(i,e){return i.type?i.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class DD extends G{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=()=>{const o=this._createButton(Nh);return o.set({label:t("Upload image from computer"),tooltip:!0}),o};if(e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n),e.ui.componentFactory.add("menuBar:uploadImage",()=>{const o=this._createButton(tm);return o.label=t("Image from computer"),o}),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>{const r=e.ui.componentFactory.create("uploadImage");return r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace image from computer":"Upload image from computer")),r},formViewCreator:()=>{const r=e.ui.componentFactory.create("uploadImage");return r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace from computer":"Upload from computer")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=hf(r),a=new e(t.locale),c=n.t;return a.set({acceptedType:r.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:c("Upload image from computer"),icon:oe.imageUpload}),a.bind("isEnabled").to(o),a.on("done",(l,d)=>{const u=Array.from(d).filter(h=>s.test(h.type));u.length&&(t.execute("uploadImage",{file:u}),t.editing.view.focus())}),a}}var mf=I(2267),ED={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(mf.A,ED),mf.A.locals;var pf=I(7693),TD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(pf.A,TD),pf.A.locals;var ff=I(1559),MD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(ff.A,MD),ff.A.locals;class ID extends G{constructor(e){super(e),this.uploadStatusChange=(t,n,o)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!o.consumable.consume(n.item,t.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(Jt),d=a?n.attributeNewValue:null,u=this.placeholder,h=r.editing.mapper.toViewElement(s),m=o.writer;if(d=="reading")return kf(h,m),void bf(c,u,h,m);if(d=="uploading"){const k=l.loaders.get(a);return kf(h,m),void(k?(wf(h,m),function(A,E,S,O){const z=function(H){const Q=H.createUIElement("div",{class:"ck-progress-bar"});return H.setCustomProperty("progressBar",!0,Q),Q}(E);E.insert(E.createPositionAt(A,"end"),z),S.on("change:uploadedPercent",(H,Q,ne)=>{O.change(se=>{se.setStyle("width",ne+"%",z)})})}(h,m,k,r.editing.view),function(A,E,S,O){if(O.data){const z=A.findViewImgElement(E);S.setAttribute("src",O.data,z)}}(c,h,m,k)):bf(c,u,h,m))}d=="complete"&&l.loaders.get(a)&&function(k,A,E){const S=A.createUIElement("div",{class:"ck-image-upload-complete-icon"});A.insert(A.createPositionAt(k,"end"),S),setTimeout(()=>{E.change(O=>O.remove(O.createRangeOn(S)))},3e3)}(h,m,r.editing.view),function(k,A){Af(k,A,"progressBar")}(h,m),wf(h,m),function(k,A){A.removeClass("ck-appear",k)}(h,m)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function kf(i,e){i.hasClass("ck-appear")||e.addClass("ck-appear",i)}function bf(i,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const o=i.findViewImgElement(t);o.getAttribute("src")!==e&&n.setAttribute("src",e,o),_f(t,"placeholder")||n.insert(n.createPositionAfter(o),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function wf(i,e){i.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",i),Af(i,e,"placeholder")}function _f(i,e){for(const t of i.getChildren())if(t.getCustomProperty(e))return t}function Af(i,e,t){const n=_f(i,t);n&&e.remove(e.createRangeOn(n))}var SD=Object.defineProperty,BD=Object.defineProperties,ND=Object.getOwnPropertyDescriptors,Cf=Object.getOwnPropertySymbols,OD=Object.prototype.hasOwnProperty,PD=Object.prototype.propertyIsEnumerable,vf=(i,e,t)=>e in i?SD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class LD extends de{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Oe(e.file),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&o.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(e,t,n){const o=this.editor,r=o.plugins.get(Jt).createLoader(e),s=o.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var u in d||(d={}))OD.call(d,u)&&vf(l,u,d[u]);if(Cf)for(var u of Cf(d))PD.call(d,u)&&vf(l,u,d[u]);return l})({},t),c={uploadId:r.id},BD(a,ND(c))),n)}}class zD extends G{constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Jt,$a,Ft,At]}static get pluginName(){return"ImageUploadEditing"}init(){const e=this.editor,t=e.model.document,n=e.conversion,o=e.plugins.get(Jt),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=hf(e.config.get("image.upload.types")),c=new LD(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(l,d)=>{if(u=d.dataTransfer,Array.from(u.types).includes("text/html")&&u.getData("text/html")!=="")return;var u;const h=Array.from(d.dataTransfer.files).filter(m=>!!m&&a.test(m.type));h.length&&(l.stop(),e.model.change(m=>{d.targetRanges&&m.setSelection(d.targetRanges.map(k=>e.editing.mapper.toModelRange(k))),e.execute("uploadImage",{file:h})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const u=Array.from(e.editing.view.createRangeIn(d.content)).map(m=>m.item).filter(m=>function(k,A){return!(!k.isInlineImageView(A)||!A.getAttribute("src")||!A.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!A.getAttribute("src").match(/^blob:/g))}(r,m)&&!m.getAttribute("uploadProcessed")).map(m=>({promise:xD(m),imageElement:m}));if(!u.length)return;const h=new fn(e.editing.view.document);for(const m of u){h.setAttribute("uploadProcessed",!0,m.imageElement);const k=o.createLoader(m.promise);k&&(h.setAttribute("src","",m.imageElement),h.setAttribute("uploadId",k.id,m.imageElement))}}),e.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),t.on("change",()=>{const l=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const u of l)if(u.type=="insert"&&u.name!="$text"){const h=u.position.nodeAfter,m=u.position.root.rootName=="$graveyard";for(const k of RD(e,h)){const A=k.getAttribute("uploadId");if(!A)continue;const E=o.loaders.get(A);E&&(m?d.has(A)||E.abort():(d.add(A),this._uploadImageElements.set(A,k),E.status=="idle"&&this._readAndUpload(E)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:u})=>{const h=u.urls?u.urls:u;this.editor.model.change(m=>{m.setAttribute("src",h.default,d),this._parseAndSetSrcsetAttributeOnImage(h,d,m),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,o=t.locale.t,r=t.plugins.get(Jt),s=t.plugins.get($a),a=t.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(e.id))}),e.read().then(()=>{const d=e.upload(),u=c.get(e.id);if(x.isSafari){const h=t.editing.mapper.toViewElement(u),m=a.findViewImgElement(h);t.editing.view.once("render",()=>{if(!m.parent)return;const k=t.editing.view.domConverter.mapViewToDom(m.parent);if(!k)return;const A=k.style.display;k.style.display="none",k._ckHack=k.offsetHeight,k.style.display=A})}return t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image")),n.enqueueChange({isUndoable:!1},h=>{h.setAttribute("uploadStatus","uploading",u)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},u=>{const h=c.get(e.id);u.setAttribute("uploadStatus","complete",h),t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this.fire("uploadComplete",{data:d,imageElement:h})}),l()}).catch(d=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw d;e.status=="error"&&d&&s.showWarning(d,{title:o("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},u=>{u.remove(c.get(e.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const u=c.get(e.id);d.removeAttribute("uploadId",u),d.removeAttribute("uploadStatus",u),c.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let o=0;const r=Object.keys(e).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return o=Math.max(o,a),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};t.hasAttribute("width")||t.hasAttribute("height")||(s.width=o),n.setAttributes(s,t)}}}function RD(i,e){const t=i.plugins.get("ImageUtils");return Array.from(i.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}var yf=I(4642),jD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(yf.A,jD),yf.A.locals;var xf=I(3469),FD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(xf.A,FD),xf.A.locals;class VD extends de{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const o of n.modelElements)this._defaultStyles[o]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,o=t.plugins.get("ImageUtils");n.change(r=>{const s=e.value,{setImageSizes:a=!0}=e;let c=o.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(o.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=o.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&o.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}var HD=Object.defineProperty,Df=Object.getOwnPropertySymbols,UD=Object.prototype.hasOwnProperty,WD=Object.prototype.propertyIsEnumerable,Ef=(i,e,t)=>e in i?HD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Tf=(i,e)=>{for(var t in e||(e={}))UD.call(e,t)&&Ef(i,t,e[t]);if(Df)for(var t of Df(e))WD.call(e,t)&&Ef(i,t,e[t]);return i};const{objectFullWidth:qD,objectInline:Mf,objectLeft:If,objectRight:hc,objectCenter:gc,objectBlockLeft:Sf,objectBlockRight:Bf}=oe,gs={get inline(){return{name:"inline",title:"In line",icon:Mf,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:If,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Sf,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:gc,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:hc,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Bf,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:gc,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:hc,modelElements:["imageBlock"],className:"image-style-side"}}},Nf={full:qD,left:Sf,right:Bf,center:gc,inlineLeft:If,inlineRight:hc,inline:Mf},Of=[{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 Pf(i){X("image-style-configuration-definition-invalid",i)}const mc={normalizeStyles:function(i){return(i.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?gs[t]?Tf({},gs[t]):{name:t}:function(n,o){const r=Tf({},o);for(const s in n)Object.prototype.hasOwnProperty.call(o,s)||(r[s]=n[s]);return r}(gs[t.name],t),typeof t.icon=="string"&&(t.icon=Nf[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:o}){const{modelElements:r,name:s}=t;if(!(r&&r.length&&s))return Pf({style:t}),!1;{const a=[n?"imageBlock":null,o?"imageInline":null];if(!r.some(c=>a.includes(c)))return X("image-style-missing-dependency",{style:t,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,i))},getDefaultStylesConfiguration:function(i,e){return i&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:i?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(i){return i.has("ImageBlockEditing")&&i.has("ImageInlineEditing")?[...Of]:[]},warnInvalidStyle:Pf,DEFAULT_OPTIONS:gs,DEFAULT_ICONS:Nf,DEFAULT_DROPDOWN_DEFINITIONS:Of};function Lf(i,e){for(const t of e)if(t.name===i)return t}class zf extends G{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[At]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=mc,n=this.editor,o=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(o,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:r}),this._setupConversion(o,r),this._setupPostFixer(),n.commands.add("imageStyle",new VD(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,o=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const u=Lf(l.attributeNewValue,s),h=Lf(l.attributeOldValue,s),m=d.mapper.toViewElement(l.item),k=d.writer;h&&k.removeClass(h.className,m),u&&k.addClass(u.className,m)});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,u,h)=>{if(!u.modelRange)return;const m=u.viewItem,k=at(u.modelRange.getItems());if(k&&h.schema.checkAttribute(k,"imageStyle"))for(const A of l[k.name])h.consumable.consume(m,{classes:A.className})&&h.writer.setAttribute("imageStyle",A.name,k)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(At),o=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let s=!1;for(const a of t.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=o.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Rf=I(6386),GD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Rf.A,GD),Rf.A.locals;class $D extends G{static get requires(){return[zf]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=jf(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const o=jf([...t.filter(he),...mc.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of o)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,o=>{let r;const{defaultItem:s,items:a,title:c}=e,l=a.filter(m=>t.find(({name:k})=>Ff(k)===m)).map(m=>{const k=n.create(m);return m===s&&(r=k),k});a.length!==l.length&&mc.warnInvalidStyle({dropdown:e});const d=bn(o,Hr),u=d.buttonView,h=u.arrowView;return Ha(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:Vf(c,r.label),class:null,tooltip:!0}),h.unbind("label"),h.set({label:c}),u.bind("icon").toMany(l,"isOn",(...m)=>{const k=m.findIndex(In);return k<0?r.icon:l[k].icon}),u.bind("label").toMany(l,"isOn",(...m)=>{const k=m.findIndex(In);return Vf(c,k<0?r.label:l[k].label)}),u.bind("isOn").toMany(l,"isOn",(...m)=>m.some(In)),u.bind("class").toMany(l,"isOn",(...m)=>m.some(In)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{l.some(({isOn:m})=>m)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...m)=>m.some(In)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Ff(t),n=>{const o=this.editor.commands.get("imageStyle"),r=new Ae(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",s=>s===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function jf(i,e){for(const t of i)e[t.title]&&(t.title=e[t.title]);return i}function Ff(i){return`imageStyle:${i}`}function Vf(i,e){return(i?i+": ":"")+e}class KD extends G{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new _d(e)),e.commands.add("outdent",new _d(e))}}class YD extends G{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?oe.indent:oe.outdent,r=t.uiLanguageDirection=="ltr"?oe.outdent:oe.indent;this._defineButton("indent",n("Increase indent"),o),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,()=>{const r=this._createButton(Ae,e,t,n);return r.set({tooltip:!0}),r}),o.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(It,e,t,n))}_createButton(e,t,n,o){const r=this.editor,s=r.commands.get(t),a=new e(r.locale);return a.set({label:n,icon:o}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{r.execute(t),r.editing.view.focus()}),a}}class QD{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,o)=>{if(!o.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!o.schema.isInline(n.item))return;const r=o.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(o.mapper.toViewRange(n.range),c):r.unwrap(o.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:o,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=sn(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,u]of l)d==="class"?o.addClass(u,a):o.setAttribute(d,u,a);c.classes&&o.addClass(c.classes,a);for(const d in c.styles)o.setStyle(d,c.styles[d],a)}else{for(const[d,u]of l)d==="class"?o.removeClass(u,a):o.removeAttribute(d,a);c.classes&&o.removeClass(c.classes,a);for(const d in c.styles)o.removeStyle(d,a)}}})}}}const ZD=function(i,e,t){var n=i.length;return t=t===void 0?n:t,!e&&t>=n?i:Bd(i,e,t)};var JD=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Hf=function(i){return JD.test(i)},XD=function(i){return i.split("")};var Uf="\\ud800-\\udfff",eE="["+Uf+"]",pc="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",fc="\\ud83c[\\udffb-\\udfff]",Wf="[^"+Uf+"]",qf="(?:\\ud83c[\\udde6-\\uddff]){2}",Gf="[\\ud800-\\udbff][\\udc00-\\udfff]",$f="(?:"+pc+"|"+fc+")?",Kf="[\\ufe0e\\ufe0f]?",tE=Kf+$f+("(?:\\u200d(?:"+[Wf,qf,Gf].join("|")+")"+Kf+$f+")*"),nE="(?:"+[Wf+pc+"?",pc,qf,Gf,eE].join("|")+")",iE=RegExp(fc+"(?="+fc+")|"+nE+tE,"g");const oE=function(i){return i.match(iE)||[]},rE=function(i){return Hf(i)?oE(i):XD(i)},sE=function(i){return function(e){e=ra(e);var t=Hf(e)?rE(e):void 0,n=t?t[0]:e.charAt(0),o=t?ZD(t,1).join(""):e.slice(1);return n[i]()+o}}("toUpperCase"),aE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,cE=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,lE=/^((\w+:(\/{2,})?)|(\W))/i,dE=["https?","ftps?","mailto"],ms="Ctrl+K";function Yf(i,{writer:e}){const t=e.createAttributeElement("a",{href:i},{priority:5});return e.setCustomProperty("link",!0,t),t}function Qf(i,e=dE){const t=String(i),n=e.join("|");return function(o,r){return!!o.replace(aE,"").match(r)}(t,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?t:"#"}function kc(i,e){return!!i&&e.checkAttribute(i.name,"linkHref")}function bc(i,e){const t=(n=i,cE.test(n)?"mailto:":e);var n;const o=!!t&&!Zf(i);return i&&o?t+i:i}function Zf(i){return lE.test(i)}function Jf(i){window.open(i,"_blank","noopener")}class uE extends de{constructor(){super(...arguments),this.manualDecorators=new qt,this.automaticDecorators=new QD}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||at(t.getSelectedBlocks());kc(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(e,t={}){const n=this.editor.model,o=n.document.selection,r=[],s=[];for(const a in t)t[a]?r.push(a):s.push(a);n.change(a=>{if(o.isCollapsed){const c=o.getFirstPosition();if(o.hasAttribute("linkHref")){const l=Xf(o);let d=es(c,"linkHref",o.getAttribute("linkHref"),n);o.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,e)),a.setAttribute("linkHref",e,d),r.forEach(u=>{a.setAttribute(u,!0,d)}),s.forEach(u=>{a.removeAttribute(u,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(e!==""){const l=sn(o.getAttributes());l.set("linkHref",e),r.forEach(u=>{l.set(u,!0)});const{end:d}=n.insertContent(a.createText(e,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(o.getRanges(),"linkHref"),l=[];for(const u of o.getSelectedBlocks())n.schema.checkAttribute(u,"linkHref")&&l.push(a.createRangeOn(u));const d=l.slice();for(const u of c)this._isRangeToUpdate(u,l)&&d.push(u);for(const u of d){let h=u;if(d.length===1){const m=Xf(o);o.getAttribute("linkHref")===m&&(h=this._updateLinkContent(n,a,u,e),a.setSelection(a.createSelection(h)))}a.setAttribute("linkHref",e,h),r.forEach(m=>{a.setAttribute(m,!0,h)}),s.forEach(m=>{a.removeAttribute(m,h)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,o=n.getSelectedElement();return kc(o,t.schema)?o.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}_updateLinkContent(e,t,n,o){const r=t.createText(o,{linkHref:o});return e.insertContent(r,n)}}function Xf(i){if(i.isCollapsed){const e=i.getFirstPosition();return e.textNode&&e.textNode.data}{const e=Array.from(i.getFirstRange().getItems());if(e.length>1)return null;const t=e[0];return t.is("$text")||t.is("$textProxy")?t.data:null}}class hE extends de{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kc(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,o=e.commands.get("link");t.change(r=>{const s=n.isCollapsed?[es(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),o)for(const c of o.manualDecorators)r.removeAttribute(c.id,a)})}}class gE extends xe(){constructor({id:e,label:t,attributes:n,classes:o,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=n,this.classes=o,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var ek=I(7719),mE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(ek.A,mE),ek.A.locals;var pE=Object.defineProperty,tk=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,nk=(i,e,t)=>e in i?pE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bE=(i,e)=>{for(var t in e||(e={}))fE.call(e,t)&&nk(i,t,e[t]);if(tk)for(var t of tk(e))kE.call(e,t)&&nk(i,t,e[t]);return i};const ik="automatic",wE=/^(https?:)?\/\//;class ok extends G{static get pluginName(){return"LinkEditing"}static get requires(){return[Tm,Am,Ft]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Yf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,r)=>Yf(Qf(o,t),r)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new uE(e)),e.commands.add("unlink",new hE(e));const n=function(o,r){const s={"Open in a new tab":o("Open in a new tab"),Downloadable:o("Downloadable")};return r.forEach(a=>("label"in a&&s[a.label]&&(a.label=s[a.label]),a)),r}(e.t,function(o){const r=[];if(o)for(const[s,a]of Object.entries(o)){const c=Object.assign({},a,{id:`link${sE(s)}`});r.push(c)}return r}(e.config.get("link.decorators")));this._enableAutomaticDecorators(n.filter(o=>o.mode===ik)),this._enableManualDecorators(n.filter(o=>o.mode==="manual")),e.plugins.get(Tm).registerAttribute("linkHref"),function(o,r,s,a){const c=o.editing.view,l=new Set;c.document.registerPostFixer(d=>{const u=o.model.document.selection;let h=!1;if(u.hasAttribute(r)){const m=es(u.getFirstPosition(),r,u.getAttribute(r),o.model),k=o.editing.mapper.toViewRange(m);for(const A of k.getItems())A.is("element",s)&&!A.hasClass(a)&&(d.addClass(a,A),l.add(A),h=!0)}return h}),o.conversion.for("editingDowncast").add(d=>{function u(){c.change(h=>{for(const m of l.values())h.removeClass(a,m),l.delete(m)})}d.on("insert",u,{priority:"highest"}),d.on("remove",u,{priority:"highest"}),d.on("attribute",u,{priority:"highest"}),d.on("selection",u,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:ik,callback:o=>!!o&&wE.test(o),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(o=>{t.model.schema.extend("$text",{allowAttributes:o.id});const r=new gE(o);n.add(r),t.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 u in r.styles)a.setStyle(u,r.styles[u],d);return a.setCustomProperty("link",!0,d),d}}}),t.conversion.for("upcast").elementToAttribute({view:bE({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(n,o)=>{if(!(x.isMac?o.domEvent.metaKey:o.domEvent.ctrlKey))return;let r=o.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),o.preventDefault(),Jf(s))},{context:"$capture"}),this.listenTo(t,"keydown",(n,o)=>{const r=e.commands.get("link").value;r&&o.keyCode===ke.enter&&o.altKey&&(n.stop(),Jf(r))})}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(n,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=e.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const e=this.editor,t=e.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(o,r)=>{t.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=bc(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var rk=I(3817),_E={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(rk.A,_E),rk.A.locals;class AE extends te{constructor(e,t,n){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt;const o=e.t;this._validators=n,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(o("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(o("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),br({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Fr(this.locale,Ur);return t.label=e("Link URL"),t}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const o=new Rr(this.locale);o.set({name:n.id,label:n.label,withText:!0}),o.bind("isOn").toMany([n,e],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),o.on("execute",()=>{n.set("value",!o.isOn)}),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new te;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(o=>({tag:"li",children:[o],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var sk=I(8762),CE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(sk.A,CE),sk.A.locals;class vE extends te{constructor(e,t={}){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt;const n=e.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),oe.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new jt({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(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new Ae(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const e=new Ae(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",o=>o&&Qf(o,this._linkConfig.allowedProtocols)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",o=>o||n("This link has no URL")),e.bind("isEnabled").to(this,"href",o=>!!o),e.template.tag="a",e.template.eventListeners={},e}}const un="link-ui";class yE extends G{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Yr]}static get pluginName(){return"LinkUI"}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(kv),this._balloon=e.plugins.get(Yr),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:un,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:un,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:ms},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}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 e=this.editor,t=new vE(e.locale,e.config.get("link")),n=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),t.keystrokes.set(ms,(r,s)=>{this._addFormView(),s()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),o=new(ea(AE))(e.locale,t,function(r){const s=r.t,a=r.config.get("link.allowCreatingEmptyLinks");return[c=>{if(!a&&!c.url.length)return s("Link URL must not be empty.")}]}(e));return o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.bind("isEnabled").to(t,"isEnabled"),o.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(o,"submit",()=>{if(o.isValid()){const{value:r}=o.urlInputView.fieldView.element,s=bc(r,n);e.execute("link",s,o.getDecoratorSwitchesState()),this._closeFormView()}}),this.listenTo(o.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(r,s)=>{this._closeFormView(),s()}),o}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link");e.ui.componentFactory.add("link",()=>{const n=this._createButton(Ae);return n.set({tooltip:!0,isToggleable:!0}),n.bind("isOn").to(t,"value",o=>!!o),n}),e.ui.componentFactory.add("menuBar:link",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("link"),r=new e(t.locale),s=n.t;return r.set({label:s("Link"),icon:'',keystroke:ms}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>this._showUI(!0)),r}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(ms,(n,o)=>{o(),e.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),kr({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 e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.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(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),o=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,o=c};function s(){return t.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(e.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 e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let o;if(t.markers.has(un)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(un)),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));o=e.domConverter.viewRangeToDom(s)}else o=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&et(n))return wc(t.getFirstPosition());{const o=t.getFirstRange().getTrimmed(),r=wc(o.start),s=wc(o.end);return r&&r==s&&e.createRangeIn(r).getTrimmed().isEqual(o)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(un))t.updateMarker(un,{range:n});else if(n.start.isAtEnd){const o=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker(un,{usingOperation:!1,affectsData:!1,range:t.createRange(o,n.end)})}else t.addMarker(un,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(un)&&e.change(t=>{t.removeMarker(un)})}}function wc(i){return i.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})||null}const ak=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 xE extends G{static get requires(){return[_n,ok]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?es(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const n=this.editor.model,o=n.document.selection,r=o.getFirstPosition(),s=o.getLastPosition();let a=t.getJoined(this._expandLinkRange(n,r)||t);a&&(a=a.getJoined(this._expandLinkRange(n,s)||t)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&e.setSelection(a)}_enablePasteLinking(){const e=this.editor,t=e.model,n=t.document.selection,o=e.plugins.get("ClipboardPipeline"),r=e.commands.get("link");o.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(ak);d&&d[2]===l&&(t.change(u=>{this._selectEntireLinks(u,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Em(e.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const o=ck(n.substr(0,n.length-1));return o?{url:o}:void 0});t.on("matched:data",(n,o)=>{const{batch:r,range:s,url:a}=o;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=e.model.createRange(l,c);this._applyAutoLink(a,d)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition();if(!o.parent.previousSibling)return;const r=t.createRangeIn(o.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(o.parent,0),o.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:o}=Dm(e,t),r=ck(n);if(r){const s=t.createRange(o.end.getShiftedBy(-r.length),o.end);this._applyAutoLink(r,s)}}_applyAutoLink(e,t){const n=this.editor.model,o=bc(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(t,n)&&Zf(o)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const n=this.editor.model,o=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",e,t),n.enqueueChange(()=>{o.requestUndoOnBackspace()})})}}function ck(i){const e=ak.exec(i);return e?e[2]:null}var lk=I(4808),DE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(lk.A,DE),lk.A.locals;class Ht{constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward=t.direction=="forward",this._includeSelf=!!t.includeSelf,this._sameAttributes=Oe(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return at(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of Fo(this._getStartNode(),this._isForward?"forward":"backward")){const n=t.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(o=>t.getAttribute(o)!==this._startElement.getAttribute(o)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*Fo(i,e="forward"){const t=e=="forward",n=[];let o=null;for(;rt(i);){let r=null;if(o){const s=i.getAttribute("listIndent"),a=o.getAttribute("listIndent");s>a?n[a]=o:se in i?TE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Vo=(i,e)=>{for(var t in e||(e={}))SE.call(e,t)&&uk(i,t,e[t]);if(dk)for(var t of dk(e))BE.call(e,t)&&uk(i,t,e[t]);return i},_c=(i,e)=>ME(i,IE(e));class Ui{static next(){return $()}}function rt(i){return!!i&&i.is("element")&&i.hasAttribute("listItemId")}function Ac(i,e={}){return[...Ln(i,_c(Vo({},e),{direction:"backward"})),...Ln(i,_c(Vo({},e),{direction:"forward"}))]}function Ln(i,e={}){const t=e.direction=="forward",n=Array.from(new Ht(i,_c(Vo({},e),{includeSelf:t,sameIndent:!0,sameAttributes:"listItemId"})));return t?n:n.reverse()}function hk(i,e){const t=new Ht(i,Vo({sameIndent:!0,sameAttributes:"listType"},e)),n=new Ht(i,Vo({sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"},e));return[...Array.from(t).reverse(),...n]}function ni(i){return!Ht.first(i,{sameIndent:!0,sameAttributes:"listItemId"})}function gk(i){return!Ht.first(i,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function Ho(i,e={}){i=Oe(i);const t=e.withNested!==!1,n=new Set;for(const o of i)for(const r of Ac(o,{higherIndent:t}))n.add(r);return ii(n)}function NE(i){i=Oe(i);const e=new Set;for(const t of i)for(const n of hk(t))e.add(n);return ii(e)}function Cc(i,e){const t=Ln(i,{direction:"forward"}),n=Ui.next();for(const o of t)e.setAttribute("listItemId",n,o);return t}function vc(i,e,t){const n={};for(const[r,s]of e.getAttributes())r.startsWith("list")&&(n[r]=s);const o=Ln(i,{direction:"forward"});for(const r of o)t.setAttributes(n,r);return o}function yc(i,e,{expand:t,indentBy:n=1}={}){i=Oe(i);const o=t?Ho(i):i;for(const r of o){const s=r.getAttribute("listIndent")+n;s<0?ps(r,e):e.setAttribute("listIndent",s,r)}return o}function ps(i,e){i=Oe(i);for(const t of i)t.is("element","listItem")&&e.rename(t,"paragraph");for(const t of i)for(const n of t.getAttributeKeys())n.startsWith("list")&&e.removeAttribute(n,t);return i}function Uo(i){if(!i.length)return!1;const e=i[0].getAttribute("listItemId");return!!e&&!i.some(t=>t.getAttribute("listItemId")!=e)}function ii(i){return Array.from(i).filter(e=>e.root.rootName!=="$graveyard").sort((e,t)=>e.index-t.index)}function Wo(i){const e=i.document.selection.getSelectedElement();return e&&i.schema.isObject(e)&&i.schema.isBlock(e)?e:null}function xc(i,e){return e.checkChild(i.parent,"listItem")&&e.checkChild(i,"$text")&&!e.isObject(i)}function OE(i){return i=="numbered"||i=="customNumbered"}function PE(i,e,t){return Ln(e,{direction:"forward"}).pop().index>i.index?vc(i,e,t):[]}class mk extends de{constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=pk(e.document.selection);e.change(n=>{const o=[];Uo(t)&&!ni(t[0])?(this._direction=="forward"&&o.push(...yc(t,n)),o.push(...Cc(t[0],n))):this._direction=="forward"?o.push(...yc(t,n,{expand:!0})):o.push(...function(r,s){const a=Ho(r=Oe(r)),c=new Set,l=Math.min(...a.map(u=>u.getAttribute("listIndent"))),d=new Map;for(const u of a)d.set(u,Ht.first(u,{lowerIndent:!0}));for(const u of a){if(c.has(u))continue;c.add(u);const h=u.getAttribute("listIndent")-1;if(h<0)ps(u,s);else{if(u.getAttribute("listIndent")==l){const m=PE(u,d.get(u),s);for(const k of m)c.add(k);if(m.length)continue}s.setAttribute("listIndent",h,u)}}return ii(c)}(t,n));for(const r of o){if(!r.hasAttribute("listType"))continue;const s=Ht.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(o)})}_fireAfterExecute(e){this.fire("afterExecute",ii(new Set(e)))}_checkEnabled(){let e=pk(this.editor.model.document.selection),t=e[0];if(!t)return!1;if(this._direction=="backward"||Uo(e)&&!ni(e[0]))return!0;e=Ho(e),t=e[0];const n=Ht.first(t,{sameIndent:!0});return!!n&&n.getAttribute("listType")==t.getAttribute("listType")}}function pk(i){const e=Array.from(i.getSelectedBlocks()),t=e.findIndex(n=>!rt(n));return t!=-1&&(e.length=t),e}var LE=Object.defineProperty,zE=Object.defineProperties,RE=Object.getOwnPropertyDescriptors,fk=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,kk=(i,e,t)=>e in i?LE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Dc=(i,e)=>{for(var t in e||(e={}))jE.call(e,t)&&kk(i,t,e[t]);if(fk)for(var t of fk(e))FE.call(e,t)&&kk(i,t,e[t]);return i},Ec=(i,e)=>zE(i,RE(e));class fs extends de{constructor(e,t,n={}){super(e),this.type=t,this._listWalkerOptions=n.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,o=Wo(t),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>t.schema.checkAttribute(a,"listType")||xc(a,t.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(s){const c=r[r.length-1],l=Ln(c,{direction:"forward"}),d=[];l.length>1&&d.push(...Cc(l[1],a)),d.push(...ps(r,a)),d.push(...function(u,h){const m=[];let k=Number.POSITIVE_INFINITY;for(const{node:A}of Fo(u.nextSibling,"forward")){const E=A.getAttribute("listIndent");if(E==0)break;E{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,e),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const h=(u=a,Array.from(new Ht(u,{direction:"forward",higherIndent:!0})));o.push(...yc([a,...h],r,{indentBy:c-l,expand:c{const t=Cc(this._getStartBlock(),e);this._fireAfterExecute(t)})}_fireAfterExecute(e){this.fire("afterExecute",ii(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&rt(t)&&!ni(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}}class VE extends G{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(e){return NE(e)}isFirstBlockOfListItem(e){return ni(e)}isListItemBlock(e){return rt(e)}expandListBlocksToCompleteItems(e,t={}){return Ho(e,t)}isNumberedListType(e){return OE(e)}}function _k(i){return i.is("element","ol")||i.is("element","ul")}function ks(i){return i.is("element","li")}function HE(i,e,t,n=Ck(t,e)){return i.createAttributeElement(Ak(t),null,{priority:2*e/100-100,id:n})}function UE(i,e,t){return i.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:t})}function Ak(i){return i=="numbered"||i=="customNumbered"?"ol":"ul"}function Ck(i,e){return`list-${i}-${e}`}function Xt(i,e){const t=i.nodeBefore;if(rt(t)){let n=t;for(const{node:o}of Fo(n,"backward"))if(n=o,e.has(n))return;e.set(t,n)}else{const n=i.nodeAfter;rt(n)&&e.set(n,n)}}function WE(){return(i,e,t)=>{const{writer:n,schema:o}=t;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter(u=>o.checkAttribute(u,"listItemId"));if(!r.length)return;const s=Ui.next(),a=function(u){let h=0,m=u.parent;for(;m;){if(ks(m))h++;else{const k=m.previousSibling;k&&ks(k)&&h++}m=m.parent}return h}(e.viewItem);let c=e.viewItem.parent&&e.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 u of r)u.hasAttribute("listItemId")||n.setAttributes(d,u);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&t.keepEmptyElement(r[0])}}function vk(){return(i,e,t)=>{if(!t.consumable.test(e.viewItem,{name:!0}))return;const n=new fn(e.viewItem.document);for(const o of Array.from(e.viewItem.getChildren()))ks(o)||_k(o)||n.remove(o)}}function yk(i,e,t,{dataPipeline:n}={}){const o=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)}}(i);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,u=s.item;if(!i.includes(s.attributeKey)||!o(u,d))return;const h=function(k,A,E){const S=E.createRangeOn(k);return A.toViewRange(S).getTrimmed().end.nodeBefore}(u,l,t);Dk(h,c,l),function(k,A){let E=k.parent;for(;E.is("attributeElement")&&["ul","ol","li"].includes(E.name);){const S=E.parent;A.unwrap(A.createRangeOn(k),E),E=S}}(h,c);const m=function(k,A,E,S,{dataPipeline:O}){let z=S.createRangeOn(A);if(!ni(k))return z;for(const H of E){if(H.scope!="itemMarker")continue;const Q=H.createElement(S,k,{dataPipeline:O});if(!Q||(S.setCustomProperty("listItemMarker",!0,Q),H.canInjectMarkerIntoElement&&H.canInjectMarkerIntoElement(k)?S.insert(S.createPositionAt(A,0),Q):(S.insert(z.start,Q),z=S.createRange(S.createPositionBefore(Q),S.createPositionAfter(A))),!H.createWrapperElement||!H.canWrapElement))continue;const ne=H.createWrapperElement(S,k,{dataPipeline:O});S.setCustomProperty("listItemWrapper",!0,ne),H.canWrapElement(k)?z=S.wrap(z,ne):(z=S.wrap(S.createRangeOn(Q),ne),z=S.createRange(z.start,S.createPositionAfter(A)))}return z}(u,h,e,c,{dataPipeline:n});(function(k,A,E,S){if(!k.hasAttribute("listIndent"))return;const O=k.getAttribute("listIndent");let z=k;for(let H=O;H>=0;H--){const Q=UE(S,H,z.getAttribute("listItemId")),ne=HE(S,H,z.getAttribute("listType"));for(const se of E)se.scope!="list"&&se.scope!="item"||!z.hasAttribute(se.attributeName)||se.setAttributeOnDowncast(S,z.getAttribute(se.attributeName),se.scope=="list"?ne:Q);if(A=S.wrap(A,Q),A=S.wrap(A,ne),H==0||(z=Ht.first(z,{lowerIndent:!0}),!z))break}})(u,m,e,c)}}function xk(i,{dataPipeline:e}={}){return(t,{writer:n})=>{if(!Ek(t,i))return null;if(!e)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const o=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}function Dk(i,e,t){for(;i.parent.is("attributeElement")&&i.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(i),i.parent);const n=[];o(e.createPositionBefore(i).getWalker({direction:"backward"})),o(e.createRangeIn(i).getWalker());for(const r of n)e.remove(r);function o(r){for(const{item:s}of r){if(s.is("element")&&t.toModelElement(s))break;s.is("element")&&s.getCustomProperty("listItemMarker")&&n.push(s)}}}function Ek(i,e,t=Ac(i)){if(!rt(i))return!1;for(const n of i.getAttributeKeys())if(!n.startsWith("selection:")&&!e.includes(n))return!1;return t.length<2}var Tk=I(1232),qE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Tk.A,qE),Tk.A.locals;var Mk=I(6903),GE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Mk.A,GE),Mk.A.locals;const bs=["listType","listIndent","listItemId"];class $E extends G{constructor(e){super(e),this._downcastStrategies=[],e.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[ts,_n,VE,Ft]}init(){const e=this.editor,t=e.model,n=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new B("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:bs}),n?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const o of bs)t.schema.setAttributeProperties(o,{copyOnReplace:!0});e.commands.add("numberedList",new fs(e,"numbered")),e.commands.add("bulletedList",new fs(e,"bulleted")),e.commands.add("customNumberedList",new fs(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new fs(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new mk(e,"forward")),e.commands.add("outdentList",new mk(e,"backward")),e.commands.add("splitListItemBefore",new wk(e,"before")),e.commands.add("splitListItemAfter",new wk(e,"after")),n&&(e.commands.add("mergeListItemBackward",new bk(e,"backward")),e.commands.add("mergeListItemForward",new bk(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...bs,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),n=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(o,r)=>{const s=e.model.document.selection;Wo(e.model)||e.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!rt(c))return;if(Ht.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:Ik(e.model,"backward")})}else gk(c)||e.execute("splitListItemAfter"),e.execute("outdentList");r.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:Ik(e.model,"forward")}),r.preventDefault(),o.stop()}})},{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,n=e.commands,o=n.get("enter");this.listenTo(e.editing.view.document,"enter",(r,s)=>{const a=t.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&rt(c)&&c.isEmpty&&!s.isSoft){const l=ni(c),d=gk(c);l&&d?(e.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(e.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(e.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(o,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&Ac(e.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,n)=>{const o=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,n=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),r=o?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:d})=>d.createElement(r,{listType:""})}).elementToElement({view:"p",model:(l,{writer:d})=>l.parent&&l.parent.is("element","li")?d.createElement(r,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",WE()),l.on("element:ul",vk(),{priority:"high"}),l.on("element:ol",vk(),{priority:"high"})}),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:r,view:xk(n),converterPriority:"high"}).add(l=>{var d;l.on("attribute",yk(n,this._downcastStrategies,t)),l.on("remove",(d=t.schema,(u,h,m)=>{const{writer:k,mapper:A}=m,E=u.name.split(":")[1];if(!d.checkAttribute(E,"listItemId"))return;const S=A.toViewPosition(h.position),O=h.position.getShiftedBy(h.length),z=A.toViewPosition(O,{isPhantom:!0}),H=k.createRange(S,z).getTrimmed().end.nodeBefore;H&&Dk(H,k,A)}))}),e.conversion.for("dataDowncast").elementToElement({model:r,view:xk(n,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",yk(n,this._downcastStrategies,t,{dataPipeline:!0}))});const s=(a=this._downcastStrategies,c=e.editing.view,(l,d)=>{if(d.modelPosition.offset>0)return;const u=d.modelPosition.parent;if(!rt(u)||!a.some(E=>E.scope=="itemMarker"&&E.canInjectMarkerIntoElement&&E.canInjectMarkerIntoElement(u)))return;const h=d.mapper.toViewElement(u),m=c.createRangeIn(h),k=m.getWalker();let A=m.start;for(const{item:E}of k){if(E.is("element")&&d.mapper.toModelElement(E)||E.is("$textProxy"))break;E.is("element")&&E.getCustomProperty("listItemMarker")&&(A=c.createPositionAfter(E),k.skip(({previousPosition:S})=>!S.isEqual(A)))}d.viewPosition=A});var a,c;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",function(l,d,u,h){return()=>{const E=l.document.differ.getChanges(),S=[],O=new Map,z=new Set;for(const H of E)if(H.type=="insert"&&H.name!="$text")Xt(H.position,O),H.attributes.has("listItemId")?z.add(H.position.nodeAfter):Xt(H.position.getShiftedBy(H.length),O);else if(H.type=="remove"&&H.attributes.has("listItemId"))Xt(H.position,O);else if(H.type=="attribute"){const Q=H.range.start.nodeAfter;u.includes(H.attributeKey)?(Xt(H.range.start,O),H.attributeNewValue===null?(Xt(H.range.start.getShiftedBy(1),O),k(Q)&&S.push(Q)):z.add(Q)):rt(Q)&&k(Q)&&S.push(Q)}for(const H of O.values())S.push(...m(H,z));for(const H of new Set(S))d.reconvertItem(H)};function m(E,S){const O=[],z=new Set,H=[];for(const{node:Q,previous:ne}of Fo(E,"forward")){if(z.has(Q))continue;const se=Q.getAttribute("listIndent");ne&&seu.includes(st)));const Pe=Ln(Q,{direction:"forward"});for(const st of Pe)z.add(st),(k(st,Pe)||A(st,H,S))&&O.push(st)}return O}function k(E,S){const O=d.mapper.toViewElement(E);if(!O)return!1;if(h.fire("checkElement",{modelElement:E,viewElement:O}))return!0;if(!E.is("element","paragraph")&&!E.is("element","listItem"))return!1;const z=Ek(E,u,S);return!(!z||!O.is("element","p"))||!(z||!O.is("element","span"))}function A(E,S,O){if(O.has(E))return!1;const z=d.mapper.toViewElement(E);let H=S.length-1;for(let Q=z.parent;!Q.is("editableElement");Q=Q.parent){const ne=ks(Q),se=_k(Q);if(!se&&!ne)continue;const Pe="checkAttributes:"+(ne?"item":"list");if(h.fire(Pe,{viewElement:Q,modelAttributes:S[H]}))break;if(se&&(H--,H<0))return!1}return!0}}(t,e.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:d,modelAttributes:u})=>{d.id!=u.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:d,modelAttributes:u})=>{d.name==Ak(u.listType)&&d.id==Ck(u.listType,u.listIndent)||(l.return=!0,l.stop())})}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(n=>function(o,r,s,a){const c=o.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let u=!1;for(const m of c){if(m.type=="insert"&&m.name!="$text"){const k=m.position.nodeAfter;if(!o.schema.checkAttribute(k,"listItemId"))for(const A of Array.from(k.getAttributeKeys()))s.includes(A)&&(r.removeAttribute(A,k),u=!0);Xt(m.position,l),m.attributes.has("listItemId")||Xt(m.position.getShiftedBy(m.length),l);for(const{item:A,previousPosition:E}of o.createRangeIn(k))rt(A)&&Xt(E,l)}else m.type=="remove"?Xt(m.position,l):m.type=="attribute"&&s.includes(m.attributeKey)&&(Xt(m.range.start,l),m.attributeNewValue===null&&Xt(m.range.start.getShiftedBy(1),l));if(!d&&m.type=="attribute"&&bs.includes(m.attributeKey)){const k=m.range.start.nodeAfter;m.attributeNewValue===null&&k&&k.is("element","listItem")?(r.rename(k,"paragraph"),u=!0):m.attributeOldValue===null&&k&&k.is("element")&&k.name!="listItem"&&(r.rename(k,"listItem"),u=!0)}}const h=new Set;for(const m of l.values())u=a.fire("postFixer",{listNodes:new EE(m),listHead:m,writer:r,seenIds:h})||u;return u}(e,n,t,this)),this.on("postFixer",(n,{listNodes:o,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,u=!1;for(const{node:h}of s){const m=h.getAttribute("listIndent");if(m>c){let k;d===null?(d=m-c,k=c):(d>m&&(d=m),k=m-d),k>l+1&&(k=l+1),a.setAttribute("listIndent",k,h),u=!0,l=k}else d=null,c=m+1,l=m}return u}(o,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:o,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let u=!1;for(const{node:h}of a){if(d.has(h))continue;let m=h.getAttribute("listType"),k=h.getAttribute("listItemId");if(c.has(k)&&(k=Ui.next()),c.add(k),h.is("element","listItem"))h.getAttribute("listItemId")!=k&&(l.setAttribute("listItemId",k,h),u=!0);else for(const A of Ln(h,{direction:"forward"}))d.add(A),A.getAttribute("listType")!=m&&(k=Ui.next(),m=A.getAttribute("listType")),A.getAttribute("listItemId")!=k&&(l.setAttribute("listItemId",k,A),u=!0)}return u}(o,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(n){return(o,[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(rt(c.parent))l=c.parent;else{if(!rt(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const u=l.getAttribute("listType"),h=l.getAttribute("listIndent"),m=a[0].getAttribute("listIndent")||0,k=Math.max(h-m,0);for(const A of a){const E=rt(A);l.is("element","listItem")&&A.is("element","paragraph")&&d.rename(A,"listItem"),d.setAttributes({listIndent:(E?A.getAttribute("listIndent"):0)+k,listItemId:E?A.getAttribute("listItemId"):Ui.next(),listType:u},A)}})}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(n,o)=>{e.change(r=>{const s=Array.from(o.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every(rt)&&r.remove(a),o.method=="copy"||o.method=="cut"){const c=Array.from(o.content.getChildren());Uo(c)&&ps(c,r)}})})}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function Ik(i,e){const t=i.document.selection;if(!t.isCollapsed)return!Wo(i);if(e==="forward")return!0;const n=t.getFirstPosition().parent,o=n.previousSibling;return!i.schema.isObject(o)&&(!!o.isEmpty||Uo([n,o]))}function Sk(i,e,t,n){i.ui.componentFactory.add(e,()=>{const o=Bk(Ae,i,e,t,n);return o.set({tooltip:!0,isToggleable:!0}),o}),i.ui.componentFactory.add(`menuBar:${e}`,()=>Bk(It,i,e,t,n))}function Bk(i,e,t,n,o){const r=e.commands.get(t),s=new i(e.locale);return s.set({label:n,icon:o}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{e.execute(t),e.editing.view.focus()}),s}class KE extends G{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||Sk(this.editor,"numberedList",e("Numbered List"),oe.numberedList),this.editor.ui.componentFactory.has("bulletedList")||Sk(this.editor,"bulletedList",e("Bulleted List"),oe.bulletedList)}}class YE extends G{static get requires(){return[$E,KE]}static get pluginName(){return"List"}}const QE=[{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:i,typeAttribute:e,listType:t}of QE);var Nk=I(9968),ZE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Nk.A,ZE),Nk.A.locals;var Ok=I(7141),JE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Ok.A,JE),Ok.A.locals,go("Ctrl+Enter");var Pk=I(8991),XE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Pk.A,XE),Pk.A.locals,go("Ctrl+Enter");function Lk(i,e){const t=(n,o,r)=>{if(!r.consumable.consume(o.item,n.name))return;const s=o.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(o.item),l=[...c.getChildren()].find(u=>u.getCustomProperty("media-content"));a.remove(l);const d=i.getMediaViewElement(a,s,e);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",t)}}function zk(i,e,t,n){return i.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(i,t,n),i.createSlot()])}function Rk(i){const e=i.getSelectedElement();return e&&e.is("element","media")?e:null}function jk(i,e,t,n){i.change(o=>{const r=o.createElement("media",{url:e});i.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class e5 extends de{refresh(){const e=this.editor.model,t=e.document.selection,n=Rk(t);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(o){const r=o.getSelectedElement();return!!r&&r.name==="media"}(t)||function(o,r){let a=Fm(o,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(t,e)}execute(e){const t=this.editor.model,n=t.document.selection,o=Rk(n);o?t.change(r=>{r.setAttribute("url",e,o)}):jk(t,e,n,!0)}}class t5{constructor(e,t){const n=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),s=n.concat(o).filter(a=>{const c=a.name;return c?!r.has(c):(X("media-embed-no-provider-name",{provider:a}),!1)});this.locale=e,this.providerDefinitions=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e)return new Fk(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,o=Oe(t.url);for(const r of o){const s=this._getUrlMatches(e,r);if(s)return new Fk(this.locale,e,s,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let o=e.replace(/^https?:\/\//,"");return n=o.match(t),n||(o=o.replace(/^www\./,""),n=o.match(t),n||null)}}class Fk{constructor(e,t,n,o){this.url=this._getValidUrl(t),this._locale=e,this._match=n,this._previewRenderer=o}getViewElement(e,t){const n={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),o=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new kn,t=this._locale.t;return e.content='',e.viewBox="0 0 64 42",new Gt({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}var Vk=I(7048),n5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Vk.A,n5),Vk.A.locals;class ws extends G{constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`
`},{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:t=>{const n=t[1],o=t[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:t=>`
`},{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 t5(e.locale,e.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),s=e.config.get("mediaEmbed.elementName"),a=this.registry;e.commands.add("mediaEmbed",new e5(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return zk(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),o.for("dataDowncast").add(Lk(a,{elementName:s,renderMediaPreview:r})),o.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(u,h,m){return h.setCustomProperty("media",!0,u),nc(u,h,{label:m})}(zk(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),o.for("editingDowncast").add(Lk(a,{elementName:s,renderForEditingView:!0})),o.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,u)=>{if(!u.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:h,modelCursor:m}=u.convertChildren(d.viewItem,d.modelCursor);d.modelRange=h,d.modelCursor=m,at(h.getItems())||u.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const i5=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class o5 extends G{constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[rp,_n,dp]}static get pluginName(){return"AutoMediaEmbed"}init(){const e=this.editor,t=e.model.document,n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const o=t.selection.getFirstRange(),r=ht.fromPosition(o.start);r.stickiness="toPrevious";const s=ht.fromPosition(o.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(w.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,o=n.plugins.get(ws).registry,r=new Tt(e,t),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(i5)||!o.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=ht.fromPosition(e),this._timeoutId=w.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),jk(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(_n).requestUndoOnBackspace()},100)):r.detach()}}var Hk=I(5651),r5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Hk.A,r5),Hk.A.locals;class s5 extends te{constructor(e,t){super(t);const n=t.t;this.focusTracker=new ct,this.keystrokes=new ft,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._focusables=new zt,this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,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(),br({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Fr(this.locale,Ur),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),t}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}}class a5 extends G{static get requires(){return[ws]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed");e.ui.componentFactory.add("mediaEmbed",n=>{const o=bn(n);return this._setUpDropdown(o,t),o})}_setUpDropdown(e,t){const n=this.editor,o=n.t,r=e.buttonView,s=n.plugins.get(ws).registry;e.once("change:isOpen",()=>{const a=new(ea(s5))(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);e.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=t.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),e.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),e.on("change:isOpen",()=>a.resetFormStatus()),e.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(e),a.urlInputView.fieldView.bind("value").to(t,"value"),a.urlInputView.on("change:errorText",()=>{n.ui.update()}),a.urlInputView.bind("isEnabled").to(t,"isEnabled")}),e.bind("isEnabled").to(t),r.set({label:o("Insert media"),icon:'',tooltip:!0})}}var Uk=I(70),c5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Uk.A,c5),Uk.A.locals;function Wk(i){return i!==void 0&&i.endsWith("px")}function Wi(i){return i.toFixed(2).replace(/\.?0+$/,"")+"px"}var l5=Object.defineProperty,d5=Object.defineProperties,u5=Object.getOwnPropertyDescriptors,qk=Object.getOwnPropertySymbols,h5=Object.prototype.hasOwnProperty,g5=Object.prototype.propertyIsEnumerable,Gk=(i,e,t)=>e in i?l5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,m5=(i,e)=>{for(var t in e||(e={}))h5.call(e,t)&&Gk(i,t,e[t]);if(qk)for(var t of qk(e))g5.call(e,t)&&Gk(i,t,e[t]);return i};function p5(i,e,t){if(!i.childCount)return;const n=new fn(i.document),o=function(c,l){const d=l.createRangeIn(c),u=[],h=new Set;for(const m of d.getItems()){if(!m.is("element")||!m.name.match(/^(p|h\d+|li|div)$/))continue;let k=v5(m);if(k===void 0||parseFloat(k)!=0||Array.from(m.getClassNames()).find(A=>A.startsWith("MsoList"))||(k=void 0),m.hasStyle("mso-list")||k!==void 0&&h.has(k)){const A=A5(m);u.push({element:m,id:A.id,order:A.order,indent:A.indent,marginLeft:k}),k!==void 0&&h.add(k)}else h.clear()}return u}(i,n);if(!o.length)return;const r={},s=[];for(const c of o)if(c.indent!==void 0){f5(c)||(s.length=0);const l=`${c.id}:${c.indent}`,d=Math.min(c.indent-1,s.length);if(ds.length-1||s[d].listElement.name!=h.type){d==0&&h.type=="ol"&&c.id!==void 0&&r[l]&&(h.startIndex=r[l]);const m=_5(h,n,t);if(Wk(c.marginLeft)&&(d==0||Wk(s[d-1].marginLeft))){let k=c.marginLeft;d>0&&(k=Wi(parseFloat(k)-parseFloat(s[d-1].marginLeft))),n.setStyle("padding-left",k,m)}if(s.length==0){const k=c.element.parent,A=k.getChildIndex(c.element)+1;n.insertChild(A,m,k)}else{const k=s[d-1].listItemElements;n.appendChild(m,k[k.length-1])}s[d]=(a=m5({},c),d5(a,u5({listElement:m,listItemElements:[]}))),d==0&&c.id!==void 0&&(r[l]=h.startIndex||1)}}const u=c.element.name=="li"?c.element:n.createElement("li");n.appendChild(u,s[d].listElement),s[d].listItemElements.push(u),d==0&&c.id!==void 0&&r[l]++,c.element!=u&&n.appendChild(c.element,u),C5(c.element,n),n.removeStyle("text-indent",c.element),n.removeStyle("margin-left",c.element)}else{const l=s.find(d=>d.marginLeft==c.marginLeft);if(l){const d=l.listItemElements;n.appendChild(c.element,d[d.length-1]),n.removeStyle("margin-left",c.element)}else s.length=0}var a}function f5(i){const e=i.element.previousSibling;return k5(e||i.element.parent)}function k5(i){return i.is("element","ol")||i.is("element","ul")}function b5(i,e){const t=new RegExp(`@list l${i.id}:level${i.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,o=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${i.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),s=new RegExp(`@list l${i.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=r.exec(e),c=s.exec(e),l=a&&!c,d=t.exec(e);let u="decimal",h="ol",m=null;if(d&&d[1]){const k=n.exec(d[1]);if(k&&k[1]&&(u=k[1].trim(),h=u!=="bullet"&&u!=="image"?"ol":"ul"),u==="bullet"){const A=function(E){if(E.name=="li"&&E.parent.name=="ul"&&E.parent.hasAttribute("type"))return E.parent.getAttribute("type");const S=function(z){if(z.getChild(0).is("$text"))return null;for(const H of z.getChildren()){if(!H.is("element","span"))continue;const Q=H.getChild(0);if(Q)return Q.is("$text")?Q:Q.getChild(0)}return null}(E);if(!S)return null;const O=S._data;return O==="o"?"circle":O==="·"?"disc":O==="§"?"square":null}(i.element);A&&(u=A)}else{const A=o.exec(d[1]);A&&A[1]&&(m=parseInt(A[1]))}l&&(h="ol")}return{type:h,startIndex:m,style:w5(u),isLegalStyleList:l}}function w5(i){if(i.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(i){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return i;default:return null}}function _5(i,e,t){const n=e.createElement(i.type);return i.style&&e.setStyle("list-style-type",i.style,n),i.startIndex&&i.startIndex>1&&e.setAttribute("start",i.startIndex,n),i.isLegalStyleList&&t&&e.addClass("legal-list",n),n}function A5(i){const e=i.getStyle("mso-list");if(e===void 0)return{};const t=e.match(/(^|\s{1,100})l(\d+)/i),n=e.match(/\s{0,100}lfo(\d+)/i),o=e.match(/\s{0,100}level(\d+)/i);return t&&n&&o?{id:t[2],order:n[1],indent:parseInt(o[1])}:{indent:1}}function C5(i,e){const t=new cn({name:"span",styles:{"mso-list":"Ignore"}}),n=e.createRangeIn(i);for(const o of n)o.type==="elementStart"&&t.match(o.item)&&e.remove(o.item)}function v5(i){const e=i.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:function(t){const n=parseFloat(t);return t.endsWith("pt")?Wi(96*n/72):t.endsWith("pc")?Wi(12*n*96/72):t.endsWith("in")?Wi(96*n):t.endsWith("cm")?Wi(96*n/2.54):t.endsWith("mm")?Wi(n/10*96/2.54):t}(e)}function y5(i,e){if(!i.childCount)return;const t=new fn(i.document),n=function(r,s){const a=s.createRangeIn(r),c=new cn({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const u=d.item,h=u.previousSibling,m=h&&h.is("element")?h.name:null,k=["Chart"],A=c.match(u),E=u.getAttribute("o:gfxdata"),S=m==="v:shapetype",O=E&&k.some(z=>u.getAttribute("id").includes(z));A&&E&&!S&&!O&&l.push(d.item.getAttribute("id"))}return l}(i,t);(function(r,s,a){const c=a.createRangeIn(s),l=new cn({name:"img"}),d=[];for(const u of c)if(u.item.is("element")&&l.match(u.item)){const h=u.item,m=h.getAttribute("v:shapes")?h.getAttribute("v:shapes").split(" "):[];m.length&&m.every(k=>r.indexOf(k)>-1)?d.push(h):h.getAttribute("src")||d.push(h)}for(const u of d)a.remove(u)})(n,i,t),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const h of c)if(h.type=="elementStart"&&h.item.is("element","v:shape")){const m=h.item.getAttribute("id");if(r.includes(m))continue;d(h.item.parent.getChildren(),m)||l.push(h.item)}for(const h of l){const m={src:u(h)};h.hasAttribute("alt")&&(m.alt=h.getAttribute("alt"));const k=a.createElement("img",m);a.insertChild(h.index+1,k,h.parent)}function d(h,m){for(const k of h)if(k.is("element")&&(k.name=="img"&&k.getAttribute("v:shapes")==m||d(k.getChildren(),m)))return!0;return!1}function u(h){for(const m of h.getChildren())if(m.is("element")&&m.getAttribute("src"))return m.getAttribute("src")}}(n,i,t),function(r,s){const a=s.createRangeIn(r),c=new cn({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)}(i,t);const o=function(r,s){const a=s.createRangeIn(r),c=new cn({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}(i,t);o.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(e,16))).join(""))}const D5=//i,E5=/xmlns:o="urn:schemas-microsoft-com/i;class T5{constructor(e,t=!1){this.document=e,this.hasMultiLevelListPlugin=t}isActive(e){return D5.test(e)||E5.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;p5(t,n,this.hasMultiLevelListPlugin),y5(t,e.dataTransfer.getData("text/rtf")),function(o){const r=[],s=new fn(o.document);for(const{item:a}of s.createRangeIn(o))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")||a.is("element","w:sdtpr")&&a.isEmpty||a.is("element","o:p")&&a.isEmpty)&&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)}}(t),e.content=t}}function $k(i,e,t,{blockElements:n,inlineObjectElements:o}){let r=t.createPositionAt(i,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!o.includes(s.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function Kk(i,e){return!!i&&i.is("element")&&e.includes(i.name)}const M5=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class I5{constructor(e){this.document=e}isActive(e){return M5.test(e)}execute(e){const t=new fn(this.document),{body:n}=e._parsedData;(function(o,r){for(const s of o.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=o.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),o)}})(n,t),function(o,r){for(const s of r.createRangeIn(o)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,t),function(o,r){const s=new xr(r.document.stylesProcessor),a=new Tr(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const u of r.createRangeIn(o)){const h=u.item;if(h.is("element","br")){const m=$k(h,"forward",r,{blockElements:c,inlineObjectElements:l}),k=$k(h,"backward",r,{blockElements:c,inlineObjectElements:l}),A=Kk(m,c);(Kk(k,c)||A)&&d.push(h)}}for(const u of d)u.hasClass("Apple-interchange-newline")?r.remove(u):r.replace(u,r.createElement("p"))}(n,t),e.content=n}}const S5=/(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join("  ").substr(0,t.length))}function N5(i,e){const t=new DOMParser,n=function(c){return Yk(Yk(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="",u=c.indexOf(l);if(u<0)return c;const h=c.indexOf(d,u+l.length);return c.substring(0,u+l.length)+(h>=0?c.substring(h):"")}(i=(i=i.replace(//g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((d=(d=c.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("

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

${d}

`),h=d),l=this.editor.data.htmlProcessor.toView(h)}var d;const u=new V(this,"inputTransformation");this.fire(u,{content:l,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),u.stop.called&&s.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(s.stop(),t.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,a)=>{a.resultRange=r._pasteFragmentWithMarkers(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document,o=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,t.selection,r.name)};this.listenTo(n,"copy",o,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{e.model.canEditAt(e.model.document.selection)?o(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=e.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",mm(s.content))),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}class wm{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(n,o)=>{o.isLocal&&o.isUndoable&&o!==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(e){this._size+=e,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(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class lx extends de{constructor(e,t){super(e),this._buffer=new wm(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,o=e.text||"",r=o.length;let s=n.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const a=e.resultRange;t.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(c.createText(o,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const _m=["insertText","insertReplacementText"];class dx extends ln{constructor(e){super(e),this.focusObserver=e.getObserver(Br),x.isAndroid&&_m.push("insertCompositionText");const t=e.document;t.on("beforeinput",(n,o)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=o;if(!_m.includes(a))return;this.focusObserver.flush();const l=new V(t,"insertText");t.fire(l,new Mi(e,c,{text:r,selection:e.createSelection(s)})),l.stop.called&&n.stop()}),t.on("compositionend",(n,{data:o,domEvent:r})=>{this.isEnabled&&!x.isAndroid&&o&&t.fire("insertText",new Mi(e,r,{text:o,selection:t.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class Am extends G{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,n=e.editing.view,o=t.document.selection;n.addObserver(dx);const r=new lx(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",r),e.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,u=Array.from(l.getRanges()).map(k=>e.editing.mapper.toModelRange(k));let h=c;if(x.isAndroid){const k=Array.from(u[0].getItems()).reduce((A,E)=>A+(E.is("$textProxy")?E.data:""),"");k&&(k.length<=h.length?h.startsWith(k)&&(h=h.substring(k.length),u[0].start=u[0].start.getShiftedBy(k.length)):k.startsWith(h)&&(u[0].start=u[0].start.getShiftedBy(h.length),h=""))}const m={text:h,selection:t.createSelection(u)};d&&(m.resultRange=e.editing.mapper.toModelRange(d)),e.execute("insertText",m),n.scrollToTheSelection()}),x.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!o.isCollapsed&&a.keyCode==229&&n.document.isComposing&&Cm(t,r)}):this.listenTo(n.document,"compositionstart",()=>{o.isCollapsed||Cm(t,r)})}}function Cm(i,e){if(!e.isEnabled)return;const t=e.buffer;t.lock(),i.enqueueChange(t.batch,()=>{i.deleteContent(i.document.selection)}),t.unlock()}class vm extends de{constructor(e,t){super(e),this.direction=t,this._buffer=new wm(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const r=o.createSelection(e.selection||n.selection);if(!t.canEditAt(r))return;const s=e.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(o);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+=hi(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),o.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o))||!t.schema.checkChild(o,"paragraph"))return!1;const r=o.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,o=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(r,o),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const o=e.getFirstPosition(),r=n.schema.getLimitElement(o),s=r.getChild(0);return o.parent==s&&!!e.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const ym="word",Nn="selection",Ri="backward",Oo="forward",xm={deleteContent:{unit:Nn,direction:Ri},deleteContentBackward:{unit:"codePoint",direction:Ri},deleteWordBackward:{unit:ym,direction:Ri},deleteHardLineBackward:{unit:Nn,direction:Ri},deleteSoftLineBackward:{unit:Nn,direction:Ri},deleteContentForward:{unit:"character",direction:Oo},deleteWordForward:{unit:ym,direction:Oo},deleteHardLineForward:{unit:Nn,direction:Oo},deleteSoftLineForward:{unit:Nn,direction:Oo}};class ux extends ln{constructor(e){super(e);const t=e.document;let n=0;t.on("keydown",()=>{n++}),t.on("keyup",()=>{n=0}),t.on("beforeinput",(o,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=xm[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==Nn&&(d.selectionToRemove=e.createSelection(s[0])),c==="deleteContentBackward"&&(x.isAndroid&&(d.sequence=1),function(h){if(h.length!=1||h[0].isCollapsed)return!1;const m=h[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let k=0;for(const{nextPosition:A,item:E}of m){if(A.parent.is("$text")){const S=A.parent.data,O=A.offset;if(Qs(S,O)||Zs(S,O)||sd(S,O))continue;k++}else(E.is("containerElement")||E.is("emptyElement"))&&k++;if(k>1)return!0}return!1}(s)&&(d.unit=Nn,d.selectionToRemove=e.createSelection(s)));const u=new Di(t,"delete",s[0]);t.fire(u,new Mi(e,a,d)),u.stop.called&&o.stop()}),x.isBlink&&function(o){const r=o.view,s=r.document;let a=null,c=!1;function l(u){return u==ke.backspace||u==ke.delete}function d(u){return u==ke.backspace?Ri:Oo}s.on("keydown",(u,{keyCode:h})=>{a=h,c=!1}),s.on("keyup",(u,{keyCode:h,domEvent:m})=>{const k=s.selection,A=o.isEnabled&&h==a&&l(h)&&!k.isCollapsed&&!c;if(a=null,A){const E=k.getFirstRange(),S=new Di(s,"delete",E),O={unit:Nn,direction:d(h),selectionToRemove:k};s.fire(S,new Mi(r,m,O))}}),s.on("beforeinput",(u,{inputType:h})=>{const m=xm[h];l(a)&&m&&m.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(u,{inputType:h,data:m})=>{a==ke.delete&&h=="insertText"&&m==""&&u.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class _n extends G{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,o=e.model.document;t.addObserver(ux),this._undoOnBackspace=!1;const r=new vm(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new vm(e,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:u}=a,h=c==="forward"?"deleteForward":"delete",m={sequence:l};if(u=="selection"){const k=Array.from(d.getRanges()).map(A=>e.editing.mapper.toModelRange(A));m.selection=e.model.createSelection(k)}else m.unit=u;e.execute(h,m),t.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,e.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(o,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class hx extends G{static get requires(){return[Am,_n]}static get pluginName(){return"Typing"}}function Dm(i,e){let t=i.start;return{text:Array.from(i.getWalker({ignoreElementEnd:!1})).reduce((n,{item:o})=>o.is("$text")||o.is("$textProxy")?n+o.data:(t=e.createPositionAfter(o),""),""),range:e.createRange(t,i.end)}}class Em extends xe(){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,o=n.document.selection,r=n.createRange(n.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:a}=Dm(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(t,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${e}`,l)}}}class Tm extends G{constructor(e){super(e),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const e=this.editor,t=e.model,n=e.editing.view,o=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==ke.arrowright,l=a.keyCode==ke.arrowleft;if(!c&&!l)return;const d=o.contentLanguageDirection;let u=!1;u=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&Vt(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model,o=n.document.selection,r=o.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!An(o,t))&&!!Vt(r,t)&&(Lo(e),An(o,t)&&Vt(r,t,!0)?Po(n,t):this._overrideGravity(),!0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,o=n.document.selection,r=o.getFirstPosition();return this._isGravityOverridden?(Lo(e),this._restoreGravity(),Vt(r,t,!0)?Po(n,t):Xr(n,t,r),!0):r.isAtStart?!!An(o,t)&&(Lo(e),Xr(n,t,r),!0):!An(o,t)&&Vt(r,t,!0)?(Lo(e),Xr(n,t,r),!0):!!Mm(r,t)&&(r.isAtEnd&&!An(o,t)&&Vt(r,t)?(Lo(e),Xr(n,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(Na);let r=!1;this.listenTo(o,"mousedown",()=>{r=!0}),this.listenTo(o,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!An(n,s))return;const a=n.getFirstPosition();Vt(a,s)&&(a.isAtStart||Vt(a,s,!0)?Po(t,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,n=this.attributes;this.listenTo(e,"insertContent",()=>{const o=t.getFirstPosition();An(t,n)&&Vt(o,n)&&Po(e,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,o=e.editing.view;let r=!1,s=!1;this.listenTo(o.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=An(n,this.attributes)&&!Mm(a,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r&&(r=!1,s||e.model.enqueueChange(()=>{const a=n.getFirstPosition();An(n,this.attributes)&&Vt(a,this.attributes)&&(a.isAtStart||Vt(a,this.attributes,!0)?Po(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function An(i,e){for(const t of e)if(i.hasAttribute(t))return!0;return!1}function Xr(i,e,t){const n=t.nodeBefore;i.change(o=>{if(n){const r=[],s=i.schema.isObject(n)&&i.schema.isInline(n);for(const[a,c]of n.getAttributes())!i.schema.checkAttribute("$text",a)||s&&i.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);o.setSelectionAttribute(r)}else o.removeSelectionAttribute(e)})}function Po(i,e){i.change(t=>{t.removeSelectionAttribute(e)})}function Lo(i){i.preventDefault()}function Mm(i,e){return Vt(i.getShiftedBy(-1),e)}function Vt(i,e,t=!1){const{nodeBefore:n,nodeAfter:o}=i;for(const r of e){const s=n?n.getAttribute(r):void 0,a=o?o.getAttribute(r):void 0;if((!t||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const Im={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:ji('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:ji("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:ji("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:ji('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:ji('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:ji("'"),to:[null,"‚",null,"’"]}},Sm={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},gx=["symbols","mathematical","typography","quotes"];function mx(i){return typeof i=="string"?new RegExp(`(${Ng(i)})$`):i}function px(i){return typeof i=="string"?()=>[i]:i instanceof Array?()=>i:i}function fx(i){return(i.textNode?i.textNode:i.nodeAfter).getAttributes()}function ji(i){return new RegExp(`(^|\\s)(${i})([^${i}]*)(${i})$`)}function es(i,e,t,n){return n.createRange(Bm(i,e,t,!0,n),Bm(i,e,t,!1,n))}function Bm(i,e,t,n,o){let r=i.textNode||(n?i.nodeBefore:i.nodeAfter),s=null;for(;r&&r.getAttribute(e)==t;)s=r,r=n?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,n?"before":"after"):i}function*Nm(i,e){for(const t of e)t&&i.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class kx extends de{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,o=t.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(o.isLimit(a)||o.isLimit(c))return r||a!=c||t.deleteContent(n),!1;if(r){const l=Nm(e.model.schema,n.getAttributes());return Om(e,s.start),e.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(t.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Om(e,n.focus),!0;e.setSelection(c,0)}}return!1}}function Om(i,e){i.split(e),i.setSelection(e.parent.nextSibling,0)}const bx={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Pm extends ln{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(o,r)=>{n=r.shiftKey}),t.on("beforeinput",(o,r)=>{if(!this.isEnabled)return;let s=r.inputType;x.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=bx[s];if(!c)return;const l=new Di(t,"enter",r.targetRanges[0]);t.fire(l,new Mi(e,a,{isSoft:c.isSoft})),l.stop.called&&o.stop()})}observe(){}stopObserving(){}}class ts extends G{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document,o=this.editor.t;t.addObserver(Pm),e.commands.add("enter",new kx(e)),this.listenTo(n,"enter",(r,s)=>{n.isComposing||s.preventDefault(),s.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class wx extends de{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(o,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,u=l==d;if(a){const h=Nm(o.schema,s.getAttributes());Lm(o,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(h)}else{const h=!(c.start.isAtStart&&c.end.isAtEnd);o.deleteContent(s,{leaveUnmerged:h}),u?Lm(o,r,s.focus):h&&r.setSelection(d,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,o){if(o.rangeCount>1)return!1;const r=o.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=o.getFirstRange(),a=s.start.parent,c=s.end.parent;return!((ec(a,n)||ec(c,n))&&a!==c)}(e.schema,t.selection)}}function Lm(i,e,t){const n=e.createElement("softBreak");i.insertContent(n,t),e.setSelection(n,"after")}function ec(i,e){return!i.is("rootElement")&&(e.isLimit(i)||ec(i.parent,e))}class _x extends G{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,o=e.editing.view,r=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),o.addObserver(Pm),e.commands.add("shiftEnter",new wx(e)),this.listenTo(r,"enter",(a,c)=>{r.isComposing||c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Ax extends ye(){constructor(){super(...arguments),this._stack=[]}add(e,t){const n=this._stack,o=n[0];this._insertDescriptor(e);const r=n[0];o===r||tc(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,o=n[0];this._removeDescriptor(e);const r=n[0];o===r||tc(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(tc(e,t[n]))return;n>-1&&t.splice(n,1);let o=0;for(;t[o]&&Cx(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(o=>o.id===e);n>-1&&t.splice(n,1)}}function tc(i,e){return i&&e&&i.priority==e.priority&&ns(i.classes)==ns(e.classes)}function Cx(i,e){return i.priority>e.priority||!(i.priorityns(e.classes)}function ns(i){return Array.isArray(i)?i.sort().join(","):i}const vx='',yx="ck-widget",zm="ck-widget_selected";function et(i){return!!i.is("element")&&!!i.getCustomProperty("widget")}function nc(i,e,t={}){if(!i.is("containerElement"))throw new B("widget-to-widget-wrong-element-type",null,{element:i});return e.setAttribute("contenteditable","false",i),e.addClass(yx,i),e.setCustomProperty("widget",!0,i),i.getFillerOffset=Ex,e.setCustomProperty("widgetLabel",[],i),t.label&&function(n,o){n.getCustomProperty("widgetLabel").push(o)}(i,t.label),t.hasSelectionHandle&&function(n,o){const r=o.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new kn;return c.set("content",vx),c.render(),a.appendChild(c.element),a});o.insert(o.createPositionAt(n,0),r),o.addClass(["ck-widget_with-selection-handle"],n)}(i,e),Rm(i,e),i}function xx(i,e,t){if(e.classes&&t.addClass(Oe(e.classes),i),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],i)}function Dx(i,e,t){if(e.classes&&t.removeClass(Oe(e.classes),i),e.attributes)for(const n in e.attributes)t.removeAttribute(n,i)}function Rm(i,e,t=xx,n=Dx){const o=new Ax;o.on("change:top",(r,s)=>{s.oldDescriptor&&n(i,s.oldDescriptor,s.writer),s.newDescriptor&&t(i,s.newDescriptor,s.writer)}),e.setCustomProperty("addHighlight",(r,s,a)=>o.add(s,a),i),e.setCustomProperty("removeHighlight",(r,s,a)=>o.remove(s,a),i)}function jm(i,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],i),e.setAttribute("role","textbox",i),e.setAttribute("tabindex","-1",i),t.label&&e.setAttribute("aria-label",t.label,i),e.setAttribute("contenteditable",i.isReadOnly?"false":"true",i),i.on("change:isReadOnly",(n,o,r)=>{e.setAttribute("contenteditable",r?"false":"true",i)}),i.on("change:isFocused",(n,o,r)=>{r?e.addClass("ck-editor__nested-editable_focused",i):e.removeClass("ck-editor__nested-editable_focused",i)}),Rm(i,e),i}function Fm(i,e){const t=i.getSelectedElement();if(t){const n=On(i);if(n)return e.createRange(e.createPositionAt(t,n))}return e.schema.findOptimalInsertionRange(i)}function Ex(){return null}const Cn="widget-type-around";function ti(i,e,t){return!!i&&et(i)&&!t.isInline(e)}function On(i){return i.getAttribute(Cn)}var Vm=I(8508),Tx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Vm.A,Tx),Vm.A.locals;const Hm=["before","after"],Mx=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Um="ck-widget__type-around_disabled";class Ix extends G{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[ts,_n]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,o,r)=>{t.change(s=>{for(const a of t.document.roots)r?s.removeClass(Um,a):s.addClass(Um,a)}),r||e.model.change(s=>{s.removeSelectionAttribute(Cn)})}),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(e,t){const n=this.editor,o=n.editing.view,r=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:r}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,n,o){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=On(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,o={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&ti(c,s.item,t)&&(function(l,d,u){const h=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(m){const k=this.toDomElement(m);return function(A,E){for(const S of Hm){const O=new Gt({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${S}`],title:E[S],"aria-hidden":"true"},children:[A.ownerDocument.importNode(Mx,!0)]});A.appendChild(O.render())}}(k,d),function(A){const E=new Gt({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});A.appendChild(E.render())}(k),k});l.insert(l.createPositionAt(u,"end"),h)}(a.writer,o,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 e=this.editor,t=e.model,n=t.document.selection,o=t.schema,r=e.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:[et,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&e.model.change(l=>{l.removeSelectionAttribute(Cn)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const a=n.getSelectedElement();a&&ti(e.editing.mapper.toViewElement(a),a,o)||e.model.change(c=>{c.removeSelectionAttribute(Cn)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const k=l.mapper.toViewElement(this._currentFakeCaretModelElement);k&&(d.removeClass(Hm.map(s),k),this._currentFakeCaretModelElement=null)}const u=c.selection.getSelectedElement();if(!u)return;const h=l.mapper.toViewElement(u);if(!ti(h,u,o))return;const m=On(c.selection);m&&(d.addClass(s(m),h),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||e.model.change(d=>{d.removeSelectionAttribute(Cn)})})}_handleArrowKeyPress(e,t){const n=this.editor,o=n.model,r=o.document.selection,s=o.schema,a=n.editing.view,c=function(u,h){const m=qs(u,h);return m==="down"||m==="right"}(t.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;ti(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=On(t.document.selection);return t.change(o=>n?n!==(e?"after":"before")?(o.removeSelectionAttribute(Cn),!0):!1:(o.setSelectionAttribute(Cn,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,o=n.schema,r=t.plugins.get("Widget"),s=r._getObjectElementNextToSelection(e);return!!ti(t.editing.mapper.toViewElement(s),s,o)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Cn,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,o=n.schema,r=t.editing.mapper,s=n.document.selection,a=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!ti(r.toViewElement(a),a,o)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(Cn,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,o)=>{const r=o.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 u=l.closest(".ck-widget");return d.mapDomToView(u)}(r,t.domConverter),c=e.editing.mapper.toModelElement(a);this._insertParagraph(c,s),o.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(o,r)=>{if(o.eventPhase!="atTarget")return;const s=t.getSelectedElement(),a=e.editing.mapper.toViewElement(s),c=e.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:ti(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),o.stop())},{context:et})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=e.selection)},{priority:"high"}),x.isAndroid?this._listenToIfEnabled(e,"keydown",(t,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,o=n.schema;this._listenToIfEnabled(t.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=On(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)e.execute("delete",{selection:n.createSelection(l,"on")});else{const u=o.getNearestSelectionRange(n.createPositionAt(l,a),c);if(u)if(u.isCollapsed){const h=n.createSelection(u.start);if(n.modifySelection(h,{direction:c}),h.focus.isEqual(u.start)){const m=function(k,A){let E=A;for(const S of A.getAncestors({parentFirst:!0})){if(S.childCount>1||k.isLimit(S))break;E=S}return E}(o,u.start.parent);n.deleteContent(n.createSelection(m,"on"),{doNotAutoparagraph:!0})}else n.change(m=>{m.setSelection(u),e.execute(d?"deleteForward":"delete")})}else n.change(h=>{h.setSelection(u),e.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:et})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=On(n);return a?(o.stop(),t.change(c=>{const l=n.getSelectedElement(),d=t.createPositionAt(l,a),u=c.createSelection(d),h=t.insertContent(r,u);return c.setSelection(u),h})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(n,o)=>{const[,r,s={}]=o;if(r&&!r.is("documentSelection"))return;const a=On(t);a&&(s.findOptimalPosition=a,o[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[o])=>{o&&!o.is("documentSelection")||On(t)&&n.stop()},{priority:"high"})}}function Sx(i){const e=i.model;return(t,n)=>{const o=n.keyCode==ke.arrowup,r=n.keyCode==ke.arrowdown,s=n.shiftKey,a=e.document.selection;if(!o&&!r)return;const c=r;if(s&&function(d,u){return!d.isCollapsed&&d.isBackward==u}(a,c))return;const l=function(d,u,h){const m=d.model;if(h){const k=u.isCollapsed?u.focus:u.getLastPosition(),A=Wm(m,k,"forward");if(!A)return null;const E=m.createRange(k,A),S=qm(m.schema,E,"backward");return S?m.createRange(k,S):null}{const k=u.isCollapsed?u.focus:u.getFirstPosition(),A=Wm(m,k,"backward");if(!A)return null;const E=m.createRange(A,k),S=qm(m.schema,E,"forward");return S?m.createRange(S,k):null}}(i,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,u,h){const m=d.model,k=d.view.domConverter;if(h){const z=m.createSelection(u.start);m.modifySelection(z),z.focus.isAtEnd||u.start.isEqual(z.focus)||(u=m.createRange(z.focus,u.end))}const A=d.mapper.toViewRange(u),E=k.viewRangeToDom(A),S=ge.getDomRangeRects(E);let O;for(const z of S)if(O!==void 0){if(Math.round(z.top)>=O)return!1;O=Math.max(O,Math.round(z.bottom))}else O=Math.round(z.bottom);return!0}(i,l,c))&&(e.change(d=>{const u=c?l.end:l.start;if(s){const h=e.createSelection(a.anchor);h.setFocus(u),d.setSelection(h)}else d.setSelection(u)}),t.stop(),n.preventDefault(),n.stopPropagation())}}}function Wm(i,e,t){const n=i.schema,o=i.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of o.getWalker({startPosition:e,direction:t})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function qm(i,e,t){const n=t=="backward"?e.end:e.start;if(i.checkChild(n,"$text"))return n;for(const{nextPosition:o}of e.getWalker({direction:t}))if(i.checkChild(o,"$text"))return o;return null}var Gm=I(695),Bx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Gm.A,Bx),Gm.A.locals;class zo extends G{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[Ix,_n]}init(){const e=this.editor,t=e.editing.view,n=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{const c=a.writer,l=s.selection;if(l.isCollapsed)return;const d=l.getSelectedElement();if(!d)return;const u=e.editing.mapper.toViewElement(d);var h;et(u)&&a.consumable.consume(l,"selection")&&c.setSelection(c.createRangeOn(u),{fake:!0,label:(h=u,h.getCustomProperty("widgetLabel").reduce((m,k)=>typeof k=="function"?m?m+". "+k():k():m?m+". "+k:k,""))})}),this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,l=c.document.selection;let d=null;for(const u of l.getRanges())for(const h of u){const m=h.item;et(m)&&!Nx(m,d)&&(c.addClass(zm,m),this._previouslySelected.add(m),d=m)}},{priority:"low"}),t.addObserver(Na),this.listenTo(n,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(n,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[et,"$text"]}),this.listenTo(n,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(n,"arrowKey",Sx(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(r,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),r.stop())},{context:"$root"}),this.listenTo(n,"tab",(r,s)=>{r.eventPhase=="atTarget"&&(s.shiftKey||this._selectFirstNestedEditable()&&(s.preventDefault(),r.stop()))},{context:et,priority:"low"}),this.listenTo(n,"tab",(r,s)=>{s.shiftKey&&this._selectAncestorWidget()&&(s.preventDefault(),r.stop())},{priority:"low"}),this.listenTo(n,"keydown",(r,s)=>{s.keystroke==ke.esc&&this._selectAncestorWidget()&&(s.preventDefault(),r.stop())},{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const n=this.editor,o=n.editing.view,r=o.document;let s=t.target;if(t.domEvent.detail>=3)return void(this._selectBlockContent(s)&&t.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(et(l))return!1;l=l.parent}return!1}(s)||!et(s)&&(s=s.findAncestor(et),!s))return;x.isAndroid&&t.preventDefault(),r.isFocused||o.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(e){const t=this.editor,n=t.model,o=t.editing.mapper,r=n.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,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}(o.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(h,m){const k=new gn({startPosition:h});for(const{item:A}of k){if(m.isLimit(A)||!A.is("element"))return null;if(m.checkChild(A,"$text"))return A}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),u=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,u))}),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,o=this.editor.model,r=o.schema,s=o.document.selection,a=s.getSelectedElement(),c=qs(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const h=l?s.getLastPosition():s.getFirstPosition(),m=r.getNearestSelectionRange(h,l?"forward":"backward");return void(m&&(o.change(k=>{k.setSelection(m)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const h=s.getFirstPosition(),m=s.getLastPosition(),k=h.nodeAfter,A=m.nodeBefore;return void((k&&r.isObject(k)||A&&r.isObject(A))&&(o.change(E=>{E.setSelection(l?m:h)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const u=this._getObjectElementNextToSelection(l);if(u&&r.isObject(u)){if(r.isInline(u)&&d)return;this._setSelectionOverElement(u),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,o=n.schema,r=n.document.selection.getSelectedElement();r&&o.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(o=>{let r=t.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,o.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,o=t.document.selection,r=t.createSelection(o);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(o))return null;const s=e?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(zm,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,t=this.editor.editing.view.document;for(const n of t.selection.getFirstRange().getItems())if(n.is("editableElement")){const o=e.editing.mapper.toModelElement(n);if(!o)continue;const r=e.model.createPositionAt(o,0),s=e.model.schema.getNearestSelectionRange(r,"forward");return e.model.change(a=>{a.setSelection(s)}),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,n=e.editing.view.document.selection.getFirstPosition().parent,o=(n.is("$text")?n.parent:n).findAncestor(et);if(!o)return!1;const r=t.toModelElement(o);return!!r&&(e.model.change(s=>{s.setSelection(r,"on")}),!0)}}function Nx(i,e){return!!e&&Array.from(i.getAncestors()).includes(e)}class is extends G{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Yr]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(o){const r=o.getSelectedElement();return!(!r||!et(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:o,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void X("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,c=new ja(s.locale);if(c.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new B("widget-toolbar-duplicated",this,{toolbarId:e});const l={view:c,getRelatedElement:o,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=o(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(e,l)}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const o of this._toolbarDefinitions.values()){const r=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>e&&(e=s,t=r,n=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?$m(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Km(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const o=n.getRelatedElement(this.editor.editing.view.document.selection);$m(this.editor,o)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function $m(i,e){const t=i.plugins.get("ContextualBalloon"),n=Km(i,e);t.updatePosition(n)}function Km(i,e){const t=i.editing.view,n=wt.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Ym=I(4095),Ox={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Ym.A,Ox),Ym.A.locals;const ic=Ci("px");class Px extends te{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",t=>!t)],style:{left:e.to("left",t=>ic(t)),top:e.to("top",t=>ic(t)),width:e.to("width",t=>ic(t))}}})}}class os extends G{constructor(){super(...arguments),this.removeDropMarkerDelayed=Ys(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=$r(e=>this._updateDropMarker(e),40),this._reconvertMarkerThrottled=$r(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new Px,this._domEmitter=new(Lt()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,n,o,r,s){this.removeDropMarkerDelayed.cancel();const a=Qm(this.editor,e,t,n,o,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(e,t,n,o,r,s){const a=Qm(this.editor,e,t,n,o,r,s);return this.removeDropMarker(),a}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(o=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||o.updateMarker("drop-target",{range:e}):o.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(t){const n=this.toDomElement(t);return n.append("⁠",t.createElement("span"),"⁠"),n})}_updateDropTargetLine(e){const t=this.editor.editing,n=e.start.nodeBefore,o=e.start.nodeAfter,r=e.start.parent,s=n?t.mapper.toViewElement(n):null,a=s?t.view.domConverter.mapViewToDom(s):null,c=o?t.mapper.toViewElement(o):null,l=c?t.view.domConverter.mapViewToDom(c):null,d=t.mapper.toViewElement(r);if(!d)return;const u=t.view.domConverter.mapViewToDom(d),h=this._getScrollableRect(d),{scrollX:m,scrollY:k}=w.window,A=a?new ge(a):null,E=l?new ge(l):null,S=new ge(u).excludeScrollbarsAndBorders(),O=A?A.bottom:S.top,z=E?E.top:S.bottom,H=w.window.getComputedStyle(u),Q=O<=z?(O+z)/2:z;if(h.topa.schema.checkChild(u,h))){if(a.schema.checkChild(u,"$text"))return a.createRange(u);if(d)return rs(i,Jm(i,d.parent),n,o)}}}else if(a.schema.isInline(l))return rs(i,l,n,o)}if(a.schema.isBlock(l))return rs(i,l,n,o);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(m=>m.is("element")&&!Lx(i,m));let u=0,h=d.length;if(h==0)return a.createRange(a.createPositionAt(l,"end"));for(;ue in i?zx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class Hx extends G{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(Lt())}static get pluginName(){return"DragDropBlockToolbar"}init(){const e=this.editor;if(this.listenTo(e,"change:isReadOnly",(t,n,o)=>{o?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),x.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",(n,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(w.document,"dragover",(n,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(w.document,"drop",(n,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(w.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",(n,o,r)=>{t.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,n=t.document.selection,o=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));t.change(a=>a.setSelection(s)),this._isBlockDragging=!0,o.focus(),o.getObserver(Bo).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=e.clientY,o=document.elementFromPoint(t,n),r=this.editor.editing.view;var s,a;o&&o.closest(".ck-editor__editable")&&r.getObserver(Bo).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))Fx.call(l,d)&&ep(c,d,l[d]);if(Xm)for(var d of Xm(l))Vx.call(l,d)&&ep(c,d,l[d]);return c})({},e),a={type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:n,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()},Rx(s,jx(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var tp=I(7793),Ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(tp.A,Ux),tp.A.locals;class Wx extends G{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=Ys(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(Lt())}static get pluginName(){return"DragDrop"}static get requires(){return[Ft,zo,os,Hx]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Bo),t.addObserver(Na),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,o,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,o,r)=>{r||this._finalizeDragging(!1)}),x.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 e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=e.plugins.get(os);this.listenTo(o,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=$(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:u}=a,{clientX:h}=u;this._updatePreview({dataTransfer:l,domTarget:d,clientX:h}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(w.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(o,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(o,"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"),x.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 e=this.editor,t=e.editing.view.document,n=e.plugins.get(os);this.listenTo(t,"clipboardInput",(o,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 o.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),np(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void o.stop();r.targetRanges=[e.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Ft);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(o))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const o=np(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&o)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(o,r)=>{if(x.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=ip(r.target);if(x.isBlink&&!e.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&et(a)||(s=n.selection.editableElement)}s&&(t.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{x.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){const t=this.editor,n=t.model;t.plugins.get(os).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&n.change(o=>{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")&&o.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,n=t.model,o=n.document.selection,r=e?ip(e):null;if(r){const l=t.editing.mapper.toModelElement(r);this._draggedRange=Tt.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const s=Array.from(o.getSelectedBlocks()),a=o.getFirstRange();if(s.length==0)return void(this._draggedRange=Tt.fromRange(a));const c=op(n,s);if(s.length>1)this._draggedRange=Tt.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=Tt.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:t,clientX:n}){const o=this.editor.editing.view,r=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(r),a=w.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Pt(w.document,"div",{style:"position: fixed; left: -999999px;"}),w.document.body.appendChild(this._previewContainer));const c=new ge(s);if(s.contains(t))return;const l=parseFloat(a.paddingLeft),d=Pt(w.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,x.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=e.getData("text/html"),e.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function np(i){return x.isGecko?i.dropEffect:["all","copyMove"].includes(i.effectAllowed)?"move":"copy"}function ip(i){if(i.is("editableElement"))return null;if(i.hasClass("ck-widget__selection-handle"))return i.findAncestor(et);if(et(i))return i;const e=i.findAncestor(t=>et(t)||t.is("editableElement"));return et(e)?e:null}function op(i,e){const t=e[0],n=e[e.length-1],o=t.getCommonAncestor(n),r=i.createPositionBefore(t),s=i.createPositionAfter(n);if(o&&o.is("element")&&!i.schema.isLimit(o)){const a=i.createRangeOn(o),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return op(i,[o])}return i.createRange(r,s)}class qx extends G{static get pluginName(){return"PastePlainText"}static get requires(){return[Ft]}init(){const e=this.editor,t=e.model,n=e.editing.view,o=n.document,r=t.document.selection;let s=!1;n.addObserver(Bo),this.listenTo(o,"keydown",(a,c)=>{s=c.shiftKey}),e.plugins.get(Ft).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const u=l.getChild(0);return d.isObject(u)?!1:Array.from(u.getAttributeKeys()).length==0}(c.content,t.schema))&&t.change(l=>{const d=Array.from(r.getAttributes()).filter(([h])=>t.schema.getAttributeProperties(h).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const u=l.createRangeIn(c.content);for(const h of u.getItems())h.is("$textProxy")&&l.setAttributes(d,h)})})}}class rp extends G{static get pluginName(){return"Clipboard"}static get requires(){return[No,Ft,Wx,qx]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Gx extends de{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!sp(e.schema,n))do if(n=n.parent,!n)return;while(!sp(e.schema,n));e.change(o=>{o.setSelection(n,"in")})}}function sp(i,e){return i.isLimit(e)&&(i.checkChild(e,"$text")||i.checkChild(e,"paragraph"))}const $x=go("Ctrl+A");class Kx extends G{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.t,n=e.editing.view.document;e.commands.add("selectAll",new Gx(e)),this.listenTo(n,"keydown",(o,r)=>{vi(r)===$x&&(e.execute("selectAll"),r.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Yx extends G{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const t=this._createButton(Ae);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("selectAll"),r=new e(t.locale),s=n.t;return r.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),r}}class Qx extends G{static get requires(){return[Kx,Yx]}static get pluginName(){return"SelectAll"}}var Zx=Object.defineProperty,ap=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,cp=(i,e,t)=>e in i?Zx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class lp extends de{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))Jx.call(s,a)&&cp(r,a,s[a]);if(ap)for(var a of ap(s))Xx.call(s,a)&&cp(r,a,s[a]);return r})({},n[1]);const o=n[1];o.batchType||(o.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const o=this.editor.model,r=o.document,s=[],a=e.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(u=>u.root!=r.graveyard).filter(u=>!t2(u,c));d.length&&(e2(d),s.push(d[0]))}s.length&&o.change(l=>{l.setSelection(s,{backward:t})})}_undo(e,t){const n=this.editor.model,o=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(o.history.getOperations(a)),l=OC([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const u=d.affectedSelectable;u&&!n.canEditAt(u)&&(d=new tt(d.baseVersion)),t.addOperation(d),n.applyOperation(d),o.history.setOperationAsUndone(s,d)}}}}function e2(i){i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et!==i&&t.containsRange(i,!0))}class n2 extends lp{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);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,o),this.refresh()}}class i2 extends lp{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.refresh()}}class o2 extends G{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const e=this.editor,t=e.t;this._undoCommand=new n2(e),this._redoCommand=new i2(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(n,o)=>{const r=o[0];if(!r.isDocumentOperation)return;const s=r.batch,a=this._redoCommand.createdBatches.has(s),c=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(a?this._undoCommand.addBatch(s):c||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(n,o,r)=>{this._redoCommand.addBatch(r)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class r2 extends G{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?oe.undo:oe.redo,r=t.uiLanguageDirection=="ltr"?oe.redo:oe.undo;this._addButtonsToFactory("undo",n("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",n("Redo"),"CTRL+Y",r)}_addButtonsToFactory(e,t,n,o){const r=this.editor;r.ui.componentFactory.add(e,()=>{const s=this._createButton(Ae,e,t,n,o);return s.set({tooltip:!0}),s}),r.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(It,e,t,n,o))}_createButton(e,t,n,o,r){const s=this.editor,a=s.locale,c=s.commands.get(t),l=new e(a);return l.set({label:n,icon:r,keystroke:o}),l.bind("isEnabled").to(c,"isEnabled"),this.listenTo(l,"execute",()=>{s.execute(t),s.editing.view.focus()}),l}}class dp extends G{static get requires(){return[o2,r2]}static get pluginName(){return"Undo"}}class s2 extends xe(){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,o)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class Jt extends G{constructor(){super(...arguments),this.loaders=new qt,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[xh]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return X("filerepository-no-upload-adapter"),null;const t=new up(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const o of this.loaders)n+=o.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const o of this.loaders)o.uploadTotal&&(n+=o.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof up?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,o)=>{n===t&&this._loadersMap.delete(o)})}_updatePendingAction(){const e=this.editor.plugins.get(xh);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=o=>`${t("Upload in progress")} ${parseInt(o)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}class up extends xe(){constructor(e,t){super(),this.id=$(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new s2,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,o)=>o?n/o*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new B("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new B("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="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(e){const t={};return t.promise=new Promise((n,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,o(r)})}),t}}const hp="ckCsrfToken",gp="abcdefghijklmnopqrstuvwxyz0123456789";function a2(){let i=function(n){n=n.toLowerCase();const o=document.cookie.split(";");for(const r of o){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(hp);var e,t;return i&&i.length==40||(i=function(n){let o="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return o}(40),e=hp,t=i,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),i}class c2{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const o=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;o.addEventListener("error",()=>t(s)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const a=o.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:s);e({default:a.url})}),o.upload&&o.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",a2()),this.xhr.send(t)}}function Pn(i,e,t,n){let o,r=null;typeof n=="function"?o=n:(r=i.commands.get(n),o=()=>{i.execute(n)}),i.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const c=at(i.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(i.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const u=d.position.parent;if(u.is("element","codeBlock")||u.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const h=u.getChild(0),m=i.model.createRangeOn(h);if(!m.containsRange(c)&&!c.end.isEqual(m.end))return;const k=t.exec(h.data.substr(0,c.end.offset));k&&i.model.enqueueChange(A=>{const E=A.createPositionAt(u,0),S=A.createPositionAt(u,k[0].length),O=new Tt(E,S);if(o({match:k})!==!1){A.remove(O);const z=i.model.document.selection.getFirstRange(),H=A.createRangeIn(u);!u.isEmpty||H.isEqual(z)||H.containsRange(z,!0)||A.remove(u)}O.detach(),i.model.enqueueChange(()=>{i.plugins.get("Delete").requestUndoOnBackspace()})})})}function Fi(i,e,t,n){let o,r;t instanceof RegExp?o=t:r=t,r=r||(s=>{let a;const c=[],l=[];for(;(a=o.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:u,2:h,3:m}=a;const k=u+h+m;d+=a[0].length-k.length;const A=[d,d+u.length],E=[d+u.length+h.length,d+u.length+h.length+m.length];c.push(A),c.push(E),l.push([d+u.length,d+u.length+h.length])}return{remove:c,format:l}}),i.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!e.isEnabled)return;const c=i.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),u=d[0];if(d.length!=1||u.type!=="insert"||u.name!="$text"||u.length!=1)return;const h=l.focus,m=h.parent,{text:k,range:A}=function(z,H){let Q=z.start;return{text:Array.from(z.getItems()).reduce((se,Pe)=>!Pe.is("$text")&&!Pe.is("$textProxy")||Pe.getAttribute("code")?(Q=H.createPositionAfter(Pe),""):se+Pe.data,""),range:H.createRange(Q,z.end)}}(c.createRange(c.createPositionAt(m,0),h),c),E=r(k),S=mp(A.start,E.format,c),O=mp(A.start,E.remove,c);S.length&&O.length&&c.enqueueChange(z=>{if(n(z,S)!==!1){for(const H of O.reverse())z.remove(H);c.enqueueChange(()=>{i.plugins.get("Delete").requestUndoOnBackspace()})}})})}function mp(i,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(i.getShiftedBy(n[0]),i.getShiftedBy(n[1])))}function ss(i,e){return(t,n)=>{if(!i.commands.get(e).isEnabled)return!1;const o=i.model.schema.getValidRanges(n,e);for(const r of o)t.setAttribute(e,!0,r);t.removeSelectionAttribute(e)}}class pp extends de{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)o?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)o?r.setAttribute(this.attributeKey,o,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const o of n.getRanges())for(const r of o.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const Vi="bold";class l2 extends G{static get pluginName(){return"BoldEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vi}),e.model.schema.setAttributeProperties(Vi,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Vi,view:"strong",upcastAlso:["b",n=>{const o=n.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Vi,new pp(e,Vi)),e.keystrokes.set("CTRL+B",Vi),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function fp({editor:i,commandName:e,plugin:t,icon:n,label:o,keystroke:r}){return s=>{const a=i.commands.get(e),c=new s(i.locale);return c.set({label:o,icon:n,keystroke:r,isToggleable:!0}),c.bind("isEnabled").to(a,"isEnabled"),t.listenTo(c,"execute",()=>{i.execute(e),i.editing.view.focus()}),c}}const as="bold";class d2 extends G{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.locale.t,n=e.commands.get(as),o=fp({editor:e,commandName:as,plugin:this,icon:oe.bold,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(as,()=>{const r=o(Ae);return r.set({tooltip:!0}),r.bind("isOn").to(n,"value"),r}),e.ui.componentFactory.add("menuBar:"+as,()=>o(It))}}var kp=I(4199),u2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(kp.A,u2),kp.A.locals;const Hi="italic";class h2 extends G{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Hi}),e.model.schema.setAttributeProperties(Hi,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Hi,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Hi,new pp(e,Hi)),e.keystrokes.set("CTRL+I",Hi),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const cs="italic";class g2 extends G{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.commands.get(cs),n=e.locale.t,o=fp({editor:e,commandName:cs,plugin:this,icon:'',keystroke:"CTRL+I",label:n("Italic")});e.ui.componentFactory.add(cs,()=>{const r=o(Ae);return r.set({tooltip:!0}),r.bind("isOn").to(t,"value"),r}),e.ui.componentFactory.add("menuBar:"+cs,()=>o(It))}}class m2 extends de{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,o=t.document.selection,r=Array.from(o.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(a=>{if(s){const c=r.filter(l=>ls(l)||wp(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(ls))})}_getValue(){const e=at(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!ls(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=at(e.getSelectedBlocks());return!!n&&wp(t,n)}_removeQuote(e,t){bp(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const o=e.createPositionAfter(n.end.parent);e.move(n,o)})}_applyQuote(e,t){const n=[];bp(e,t).reverse().forEach(o=>{let r=ls(o.start);r||(r=e.createElement("blockQuote"),e.wrap(o,r)),n.push(r)}),n.reverse().reduce((o,r)=>o.nextSibling==r?(e.merge(e.createPositionAfter(o)),o):r)}}function ls(i){return i.parent.name=="blockQuote"?i.parent:null}function bp(i,e){let t,n=0;const o=[];for(;n{const a=e.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")&&!t.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const u of d.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!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,o=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!o.isCollapsed||!r.value||o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!o.isCollapsed||!r.value)return;const c=o.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var _p=I(8708),f2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(_p.A,f2),_p.A.locals;class k2 extends G{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.commands.get("blockQuote");e.ui.componentFactory.add("blockQuote",()=>{const n=this._createButton(Ae);return n.set({tooltip:!0}),n.bind("isOn").to(t,"value"),n}),e.ui.componentFactory.add("menuBar:blockQuote",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("blockQuote"),r=new e(t.locale),s=n.t;return r.set({label:s("Block quote"),icon:oe.quote,isToggleable:!0}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r}}class b2 extends G{static get pluginName(){return"CKBoxUI"}afterInit(){const e=this.editor;if(!e.commands.get("ckbox"))return;const t=e.t,n=e.ui.componentFactory;if(n.add("ckbox",()=>{const o=this._createButton(Ae);return o.tooltip=!0,o}),n.add("menuBar:ckbox",()=>this._createButton(It)),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckbox"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=oe.imageAssetManager,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=oe.imageAssetManager,r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=t.locale,o=new e(n),r=t.commands.get("ckbox"),s=n.t;return o.set({label:s("Open file manager"),icon:oe.browseFiles}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",()=>{t.execute("ckbox")}),o}}var w2=["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","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Ro=i=>{let e=0;for(let t=0;t{let e=i/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},rc=i=>{let e=Math.max(0,Math.min(1,i));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},sc=(i,e)=>(t=>t<0?-1:1)(i)*Math.pow(Math.abs(i),e),Ap=class extends Error{constructor(i){super(i),this.name="ValidationError",this.message=i}},_2=i=>{if(!i||i.length<6)throw new Ap("The blurhash string must be at least 6 characters");let e=Ro(i[0]),t=Math.floor(e/9)+1,n=e%9+1;if(i.length!==4+2*n*t)throw new Ap(`blurhash length mismatch: length is ${i.length} but it should be ${4+2*n*t}`)},A2=i=>{let e=i>>8&255,t=255&i;return[oc(i>>16),oc(e),oc(t)]},C2=(i,e)=>{let t=Math.floor(i/361),n=Math.floor(i/19)%19,o=i%19;return[sc((t-9)/9,2)*e,sc((n-9)/9,2)*e,sc((o-9)/9,2)*e]},v2=(i,e,t,n)=>{_2(i),n|=1;let o=Ro(i[0]),r=Math.floor(o/9)+1,s=o%9+1,a=(Ro(i[1])+1)/166,c=new Array(s*r);for(let u=0;ue in i?y2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;function yp(i){const e=[];let t=0;for(const o in i){const r=parseInt(o,10);isNaN(r)||(r>t&&(t=r),e.push(`${i[o]} ${o}w`))}const n=[{srcset:e.join(","),sizes:`(max-width: ${t}px) 100vw, ${t}px`,type:"image/webp"}];return{imageFallbackUrl:i.default,imageSources:n}}const jo=32;function xp({url:i,method:e="GET",data:t,onUploadProgress:n,signal:o,authorization:r}){const s=new XMLHttpRequest;s.open(e,i.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{o.throwIfAborted(),o.addEventListener("abort",a),s.addEventListener("loadstart",()=>{o.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{o.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(t)})}const E2={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function T2(i,e){return t=this,n=null,o=function*(){try{const r=yield fetch(i,((s,a)=>{for(var c in a||(a={}))x2.call(a,c)&&vp(s,c,a[c]);if(Cp)for(var c of Cp(a))D2.call(a,c)&&vp(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},e));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(o.next(d))}catch(u){s(u)}},c=d=>{try{l(o.throw(d))}catch(u){s(u)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((o=o.apply(t,n)).next())});var t,n,o}var M2=Object.defineProperty,Dp=Object.getOwnPropertySymbols,I2=Object.prototype.hasOwnProperty,S2=Object.prototype.propertyIsEnumerable,Ep=(i,e,t)=>e in i?M2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Tp=(i,e)=>{for(var t in e||(e={}))I2.call(e,t)&&Ep(i,t,e[t]);if(Dp)for(var t of Dp(e))S2.call(e,t)&&Ep(i,t,e[t]);return i};class B2 extends de{constructor(e){super(e),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 e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");return!(!e.isEnabled&&!t.isEnabled)}_prepareOptions(){const e=this.editor.config.get("ckbox");return{theme:e.theme,language:e.language,tokenUrl:e.tokenUrl,serviceOrigin:e.serviceOrigin,forceDemoLabel:e.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:t=>this.fire("ckbox:choose",t)}}}_initListeners(){const e=this.editor,t=e.model,n=!e.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=Pt(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,e.editing.view.focus())}),this.on("ckbox:choose",(o,r)=>{if(!this.isEnabled)return;const s=e.commands.get("insertImage"),a=e.commands.get("link"),c=function({assets:d,isImageAllowed:u,isLinkAllowed:h}){return d.map(m=>function(k){const A=k.data.metadata;return A?A.width&&A.height:!1}(m)?{id:m.data.id,type:"image",attributes:N2(m)}:{id:m.data.id,type:"link",attributes:O2(m)}).filter(m=>m.type==="image"?u:h)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(t.change(d=>{for(const u of c){const h=u===c[l-1],m=l===1;this._insertAsset(u,h,d,m),n&&(setTimeout(()=>this._chosenAssets.delete(u),1e3),this._chosenAssets.add(u))}}),e.editing.view.focus())}),this.listenTo(e,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(e,t,n,o){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),e.type==="image"?this._insertImage(e):this._insertLink(e,n,o),t||n.setSelection(r.getLastPosition())}_insertImage(e){const t=this.editor,{imageFallbackUrl:n,imageSources:o,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=e.attributes;t.execute("insertImage",{source:Tp({src:n,sources:o,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(e,t,n){const o=this.editor,r=o.model,s=r.document.selection,{linkName:a,linkHref:c}=e.attributes;if(s.isCollapsed){const l=sn(s.getAttributes()),d=t.createText(a,l);if(!n){const h=s.getLastPosition(),m=h.parent;m.name==="paragraph"&&m.isEmpty||o.execute("insertParagraph",{position:h});const k=r.insertContent(d);return t.setSelection(k),void o.execute("link",c)}const u=r.insertContent(d);t.setSelection(u)}o.execute("link",c)}}function N2(i){const{imageFallbackUrl:e,imageSources:t}=yp(i.data.imageUrls),{description:n,width:o,height:r,blurHash:s}=i.data.metadata,a=function(c){if(c)try{const l=`${jo}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const u=d.getContext("2d");if(!u)return;const h=u.createImageData(jo,jo),m=v2(c,jo,jo);return h.data.set(m),u.putImageData(h,0,0),d.toDataURL()}catch{return}}(s);return Tp({imageFallbackUrl:e,imageSources:t,imageTextAlternative:n||"",imageWidth:o,imageHeight:r},a?{imagePlaceholder:a}:null)}function O2(i){return{linkName:i.data.name,linkHref:P2(i)}}function P2(i){const e=new URL(i.data.url);return e.searchParams.set("download","true"),e.toString()}var ac=(i,e,t)=>new Promise((n,o)=>{var r=c=>{try{a(t.next(c))}catch(l){o(l)}},s=c=>{try{a(t.throw(c))}catch(l){o(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((t=t.apply(i,e)).next())});class Mp extends G{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return ac(this,null,function*(){const e=this.editor,t=!!e.config.get("ckbox"),n=!!window.CKBox;if(!t&&!n)return;e.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:e.locale.uiLanguage,theme:"lark",tokenUrl:e.config.get("cloudServices.tokenUrl")});const o=e.plugins.get("CloudServices"),r=e.config.get("cloudServices.tokenUrl"),s=e.config.get("ckbox.tokenUrl");if(!s)throw new B("ckbox-plugin-missing-token-url",this);this._token=s==r?o.token:yield o.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const e=(0,this.editor.t)("Cannot access default workspace."),t=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(o,r){const[,s]=o.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,t);if(n==null)throw re("ckbox-access-default-workspace-error"),e;return n}getCategoryIdForFile(e,t){return ac(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),o=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(t),s=typeof e=="string"?(a=yield T2(e,t),E2[a]):function(d){const u=d.name,h=new RegExp("\\.(?[^.]+)$");return u.match(h).groups.ext.toLowerCase()}(e);var a;const c=yield r;if(!c)throw n;if(o){const d=Object.keys(o).find(u=>o[u].find(h=>h.toLowerCase()==s));if(d){const u=c.find(h=>h.id===d||h.name===d);if(!u)throw n;return u.id}}const l=c.find(d=>d.extensions.find(u=>u.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(e){return ac(this,null,function*(){const t=this.editor,n=this._token,{signal:o}=e,r=t.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const u=yield a(d);c.push(...u.items),l=u.totalCount-(d+50),d+=50}while(l>0);return c}catch{return o.throwIfAborted(),void re("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit",50 .toString()),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),xp({url:l,signal:o,authorization:n.value})}})}}var cc=(i,e,t)=>new Promise((n,o)=>{var r=c=>{try{a(t.next(c))}catch(l){o(l)}},s=c=>{try{a(t.throw(c))}catch(l){o(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((t=t.apply(i,e)).next())});class L2 extends G{static get requires(){return["ImageUploadEditing","ImageUploadProgress",Jt,Ip]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return cc(this,null,function*(){const e=this.editor,t=!!e.config.get("ckbox"),n=!!window.CKBox;if(!t&&!n)return;const o=e.plugins.get(Jt),r=e.plugins.get(Mp);o.createUploadAdapter=c=>new z2(c,e,r);const s=!e.config.get("ckbox.ignoreDataId"),a=e.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{e.model.change(u=>{u.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class z2{constructor(e,t,n){this.loader=e,this.token=n.getToken(),this.ckboxUtils=n,this.editor=t,this.controller=new AbortController,this.serviceOrigin=t.config.get("ckbox.serviceOrigin")}upload(){return cc(this,null,function*(){const e=this.ckboxUtils,t=this.editor.t,n=yield this.loader.file,o=yield e.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",e.getWorkspaceId()),s.append("categoryId",o),s.append("file",n),xp({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=>cc(this,null,function*(){const c=yp(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=t("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class Ip extends G{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",L2,Mp]}init(){const e=this.editor;this._shouldBeInitialised()&&(this._checkImagePlugins(),Bp()&&e.commands.add("ckbox",new B2(e)))}afterInit(){const e=this.editor;this._shouldBeInitialised()&&(e.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()))}_shouldBeInitialised(){return!!this.editor.config.get("ckbox")||Bp()}_checkImagePlugins(){const e=this.editor;e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||re("ckbox-plugin-image-feature-missing",e)}_initSchema(){const e=this.editor.model.schema;e.extend("$text",{allowAttributes:"ckboxLinkId"}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.addAttributeCheck((t,n)=>{if(!t.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const e=this.editor;e.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(o,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,o.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(u=>u.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",(o,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,o.name)){if(r.attributeOldValue){const d=Sp(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=Sp(a,r.attributeNewValue);if(r.item.is("selection")){const u=a.document.selection;a.wrap(u.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),e.conversion.for("upcast").add(n=>{n.on("element:a",(o,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),j2(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),e.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),e.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const t=e.commands.get("replaceImageSource");t&&this.listenTo(t,"cleanupImage",(n,[o,r])=>{o.removeAttribute("ckboxImageId",r)})}_initFixers(){const e=this.editor,t=e.model,n=t.document.selection;t.document.registerPostFixer(function(o){return r=>{let s=!1;const a=o.model,c=o.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 F(l.position,l.position.getShiftedBy(l.length)):l.range,u=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const h of d.getItems()){if(u&&h.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",h),s=!0;continue}const m=R2(h,c._chosenAssets);for(const k of m){const A=k.type==="image"?"ckboxImageId":"ckboxLinkId";k.id!==h.getAttribute(A)&&(r.setAttribute(A,k.id,h),s=!0)}}}return s}}(e)),t.document.registerPostFixer(function(o){return r=>!(o.hasAttribute("linkHref")||!o.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function R2(i,e){const t=i.is("element","imageInline")||i.is("element","imageBlock"),n=i.hasAttribute("linkHref");return[...e].filter(o=>o.type==="image"&&t?o.attributes.imageFallbackUrl===i.getAttribute("src"):o.type==="link"&&n?o.attributes.linkHref===i.getAttribute("linkHref"):void 0)}function Sp(i,e){const t=i.createAttributeElement("a",{"data-ckbox-resource-id":e},{priority:5});return i.setCustomProperty("link",!0,t),t}function j2(i){return!!i.is("$text")||!(!i.is("element","imageInline")&&!i.is("element","imageBlock"))}function Bp(){return!!window.CKBox}var Np=I(1866),F2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Np.A,F2),Np.A.locals;class V2 extends G{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;if(t.add("ckfinder",o=>{const r=this._createButton(Ae),s=o.t;return r.set({label:s("Insert image or file"),tooltip:!0}),r}),t.add("menuBar:ckfinder",o=>{const r=this._createButton(It),s=o.t;return r.label=s("Image or file"),r}),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckfinder"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=oe.imageAssetManager,r.bind("label").to(o,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=oe.imageAssetManager,r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=new e(t.locale),o=t.commands.get("ckfinder");return n.icon=oe.browseFiles,n.bind("isEnabled").to(o),n.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),n}}class H2 extends de{constructor(e){super(e),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if(t!="popup"&&t!="modal")throw new B("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const o=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=r=>{o&&o(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(u=>!u.isImage()),l=a.filter(u=>u.isImage());for(const u of c)e.execute("link",u.getUrl());const d=[];for(const u of l){const h=u.getUrl();d.push(h||r.request("file:getProxyUrl",{file:u}))}d.length&&Op(e,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)Op(e,[a]);else{const c=e.plugins.get("Notification"),l=e.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function Op(i,e){if(i.commands.get("insertImage").isEnabled)i.execute("insertImage",{source:e});else{const t=i.plugins.get("Notification"),n=i.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class U2 extends G{static get pluginName(){return"CKFinderEditing"}static get requires(){return[$a,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new B("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new H2(e))}}class W2 extends G{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Jt]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,o=t.uploadUrl;if(!n)return;const r=e.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,o),e.plugins.get(Jt).createUploadAdapter=s=>new q2(this._uploadGateway,s)}}class q2{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class G2 extends de{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=at(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Pp(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document,o=e.selection||n.selection;t.canEditAt(o)&&t.change(r=>{const s=o.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Pp(a,t.schema)&&r.rename(a,"paragraph")})}}function Pp(i,e){return e.checkChild(i.parent,"paragraph")&&!e.isObject(i)}class $2 extends de{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,n=e.attributes;let o=e.position;t.canEditAt(o)&&t.change(r=>{if(o=this._findPositionToInsertParagraph(o,r),!o)return;const s=r.createElement("paragraph");n&&t.schema.setAllowedAttributes(s,n,r),t.insertContent(s,o),r.setSelection(s,"in")})}_findPositionToInsertParagraph(e,t){const n=this.editor.model;if(n.schema.checkChild(e,"paragraph"))return e;const o=n.schema.findAllowedParent(e,"paragraph");if(!o)return null;const r=e.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&e.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&e.isAtStart?n.createPositionBefore(r):t.split(e,o).position}}const Lp=class extends G{static get pluginName(){return"Paragraph"}init(){const i=this.editor,e=i.model;i.commands.add("paragraph",new G2(i)),i.commands.add("insertParagraph",new $2(i)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),i.conversion.elementToElement({model:"paragraph",view:"p"}),i.conversion.for("upcast").elementToElement({model:(t,{writer:n})=>Lp.paragraphLikeElements.has(t.name)?t.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let lc=Lp;lc.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class K2 extends de{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=at(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>zp(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>zp(a,o,t.schema));for(const a of s)a.is("element",o)||r.rename(a,o)})}}function zp(i,e,t){return t.checkChild(i.parent,e)&&!t.isObject(i)}const Rp="paragraph";class Y2 extends G{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.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[lc]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)o.model!=="paragraph"&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new K2(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(o,r)=>{const s=e.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Rp)&&s.childCount===0&&r.writer.rename(s,Rp)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ee.low+1})}}var jp=I(6269),Q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(jp.A,Q2),jp.A.locals;class Z2 extends G{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.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})}(e),o=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",s=>{const a={},c=new qt,l=e.commands.get("heading"),d=e.commands.get("paragraph"),u=[l];for(const m of n){const k={type:"button",model:new Tg({label:m.title,class:m.class,role:"menuitemradio",withText:!0})};m.model==="paragraph"?(k.model.bind("isOn").to(d,"value"),k.model.set("commandName","paragraph"),u.push(d)):(k.model.bind("isOn").to(l,"value",A=>A===m.model),k.model.set({commandName:"heading",commandValue:m.model})),c.add(k),a[m.model]=m.title}const h=bn(s);return Zh(h,c,{ariaLabel:r,role:"menu"}),h.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(u,"isEnabled",(...m)=>m.some(k=>k)),h.buttonView.bind("label").to(l,"value",d,"value",(m,k)=>{const A=k?"paragraph":m;return typeof A=="boolean"?o:a[A]?a[A]:o}),h.buttonView.bind("ariaLabel").to(l,"value",d,"value",(m,k)=>{const A=k?"paragraph":m;return typeof A=="boolean"?r:a[A]?`${a[A]}, ${r}`:r}),this.listenTo(h,"execute",m=>{const{commandName:k,commandValue:A}=m.source;e.execute(k,A?{value:A}:void 0),e.editing.view.focus()}),h}),e.ui.componentFactory.add("menuBar:heading",s=>{const a=new zi(s),c=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[c],u=new Za(s);a.set({class:"ck-heading-dropdown"}),u.set({ariaLabel:t("Heading"),role:"menu"}),a.buttonView.set({label:t("Heading")}),a.panelView.children.add(u);for(const h of n){const m=new Ya(s,a),k=new It(s);m.children.add(k),u.items.add(m),k.set({label:h.title,role:"menuitemradio",class:h.class}),k.bind("ariaChecked").to(k,"isOn"),k.delegate("execute").to(a),k.on("execute",()=>{const A=h.model==="paragraph"?"paragraph":"heading";e.execute(A,{value:h.model}),e.editing.view.focus()}),h.model==="paragraph"?(k.bind("isOn").to(l,"value"),d.push(l)):k.bind("isOn").to(c,"value",A=>A===h.model)}return a.bind("isEnabled").toMany(d,"isEnabled",(...h)=>h.some(m=>m)),a})}}function Fp(i){return i.createContainerElement("figure",{class:"image"},[i.createEmptyElement("img"),i.createSlot("children")])}function Vp(i,e){const t=i.plugins.get("ImageUtils"),n=i.plugins.has("ImageInlineEditing")&&i.plugins.has("ImageBlockEditing");return r=>t.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:o(r):null;function o(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function dc(i,e){const t=at(e.getSelectedBlocks());return!t||i.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}function ds(i){return i&&i.endsWith("px")?parseInt(i):null}function Hp(i){const e=ds(i.getStyle("width")),t=ds(i.getStyle("height"));return!(!e||!t)}var J2=Object.defineProperty,Up=Object.getOwnPropertySymbols,X2=Object.prototype.hasOwnProperty,eD=Object.prototype.propertyIsEnumerable,Wp=(i,e,t)=>e in i?J2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,qp=(i,e)=>{for(var t in e||(e={}))X2.call(e,t)&&Wp(i,t,e[t]);if(Up)for(var t of Up(e))eD.call(e,t)&&Wp(i,t,e[t]);return i};const tD=/^(image|image-inline)$/;class At extends G{constructor(){super(...arguments),this._domEmitter=new(Lt())}static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null,o={}){const r=this.editor,s=r.model,a=s.document.selection,c=Gp(r,t||a,n);e=qp(qp({},Object.fromEntries(a.getAttributes())),e);for(const l in e)s.schema.checkAttribute(c,l)||delete e[l];return s.change(l=>{const{setImageSizes:d=!0}=o,u=l.createElement(c,e);return s.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:t||c=="imageInline"?void 0:"auto"}),u.parent?(d&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(n=>{const o=new w.window.Image;this._domEmitter.listenTo(o,"load",()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",o.naturalWidth,e),r.setAttribute("height",o.naturalHeight,e)}),this._domEmitter.stopListening(o,"load")}),o.src=t}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const n=e.getSelectedElement();if(n&&this.isImageWidget(n))return n;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:tD})}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if(Gp(t,n,null)=="imageBlock"){const r=function(s,a){const c=Fm(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,t.model);if(t.model.schema.checkChild(r,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),nc(e,t,{label:()=>{const o=this.findViewImgElement(e).getAttribute("alt");return o?`${o} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&et(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Gp(i,e,t){const n=i.model.schema,o=i.config.get("image.insert.type");return i.plugins.has("ImageBlockEditing")?i.plugins.has("ImageInlineEditing")?t||(o==="inline"?"imageInline":o!=="auto"?"imageBlock":e.is("selection")?dc(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class nD extends de{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),o=t.model,r=n.getClosestSelectedImageElement(o.document.selection);o.change(s=>{s.setAttribute("alt",e.newValue,r)})}}class iD extends G{static get requires(){return[At]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new nD(this.editor))}}var $p=I(4062),oD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()($p.A,oD),$p.A.locals;var Kp=I(2722),rD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Kp.A,rD),Kp.A.locals;class sD extends te{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new ct,this.keystrokes=new ft,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._focusables=new zt,this._focusCycler=new jt({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),br({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createLabeledInputView(){const e=this.locale.t,t=new Fr(this.locale,Ur);return t.label=e("Text alternative"),t}}function Yp(i){const e=i.editing.view,t=wt.defaultPositions,n=i.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.viewportStickyNorth]}}class aD extends G{static get requires(){return[Yr]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const o=e.commands.get("imageTextAlternative"),r=new Ae(n);return r.set({label:t("Change image text alternative"),icon:oe.textAlternative,tooltip:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(ea(sD))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.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",(o,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(o){const r=o.plugins.get("ContextualBalloon");if(o.plugins.get("ImageUtils").getClosestSelectedImageWidget(o.editing.view.document.selection)){const s=Yp(o);r.updatePosition(s)}}(e):this._hideForm(!0)}),kr({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Yp(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&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 Qp extends G{static get requires(){return[iD,aD]}static get pluginName(){return"ImageTextAlternative"}}function Zp(i,e){const t=(n,o,r)=>{if(!r.consumable.consume(o.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(o.item),c=i.findViewImgElement(a);o.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):o.attributeNewValue&&(s.setAttribute("srcset",o.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${e}`,t)}}function us(i,e,t){const n=(o,r,s)=>{if(!s.consumable.consume(r.item,o.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=i.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return o=>{o.on(`attribute:${t}:${e}`,n)}}class Jp extends ln{observe(e){this.listenTo(e,"load",(t,n)=>{const o=n.target;this.checkShouldIgnoreEventFromTarget(o)||o.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}var cD=Object.defineProperty,Xp=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,dD=Object.prototype.propertyIsEnumerable,ef=(i,e,t)=>e in i?cD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,hs=(i,e)=>{for(var t in e||(e={}))lD.call(e,t)&&ef(i,t,e[t]);if(Xp)for(var t of Xp(e))dD.call(e,t)&&ef(i,t,e[t]);return i};class uD extends de{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&X("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&X("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Oe(e.source),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&o.isImage(c)){const l=this.editor.model.createPositionAfter(c);o.insertImage(hs(hs({},s),r),l)}else o.insertImage(hs(hs({},s),r))})}}class hD extends de{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),n.setImageNaturalSizeAttributes(t)})}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class uc extends G{static get requires(){return[At]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(Jp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new uD(e),o=new hD(e);e.commands.add("insertImage",n),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",n)}}class tf extends G{static get requires(){return[At]}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(e){const t=this.editor,n=t.plugins.get("ImageUtils"),o=e==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${e}`,(d,u,h)=>{if(!h.consumable.consume(u.item,d.name))return;const m=h.writer,k=h.mapper.toViewElement(u.item),A=n.findViewImgElement(k);if(u.attributeNewValue!==null?m.setAttribute(c,u.attributeNewValue,A):m.removeAttribute(c,A),u.item.hasAttribute("sources"))return;const E=u.item.hasAttribute("resizedWidth");if(e==="imageInline"&&!E&&!l)return;const S=u.item.getAttribute("width"),O=u.item.getAttribute("height");S&&O&&m.setStyle("aspect-ratio",`${S}/${O}`,A)})}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:s=>Hp(s)?ds(s.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:s=>Hp(s)?ds(s.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),t.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class nf extends de{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,n=this.editor.model,o=t.plugins.get("ImageUtils"),r=o.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=e,l=Array.from(n.markers).filter(h=>h.getRange().containsItem(r)),d=o.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const u=a.createRangeOn(d);for(const h of l){const m=h.getRange(),k=m.root.rootName!="$graveyard"?m.getJoined(u,!0):u;a.updateMarker(h,{range:k})}return{oldElement:r,newElement:d}}):null}}var of=I(7378),gD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(of.A,gD),of.A.locals;class rf extends G{static get requires(){return[At]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,n=e.plugins.get("ImageUtils");t.for("editingDowncast").add(o=>{o.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 e=this.editor,t=e.model,n=e.editing,o=n.view,r=e.plugins.get("ImageUtils");o.addObserver(Jp),this.listenTo(o.document,"imageLoaded",(s,a)=>{const c=o.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")&&t.enqueueChange({isUndoable:!1},u=>{u.removeAttribute("placeholder",d)})})}}class sf extends G{static get requires(){return[uc,tf,At,rf,Ft]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new nf(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>Fp(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>o.toImageWidget(Fp(s),s,t("image widget"))}),n.for("downcast").add(us(o,"imageBlock","src")).add(us(o,"imageBlock","alt")).add(Zp(o,"imageBlock")),n.for("upcast").elementToElement({view:Vp(e,"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 u=at(l.convertItem(d,c.modelCursor).modelRange.getItems());u?(l.convertChildren(c.viewItem,u),l.updateConversionResult(u,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(o.isInlineImageView))return;l=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(l);if(dc(t.schema,d)==="imageBlock"){const u=new fn(n.document),h=c.map(m=>u.createElement("figure",{class:"image"},m));a.content=u.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&t.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(d)})})}}var af=I(3350),mD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(af.A,mD),af.A.locals;class pD extends te{constructor(e,t=[]){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt,this.children=this.createCollection(),this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of t)this.children.add(n),this._focusables.add(n),n instanceof Rv&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)fD(n)&&(n.focusCycler.on("forwardCycle",o=>{this._focusCycler.focusNext(),o.stop()}),n.focusCycler.on("backwardCycle",o=>{this._focusCycler.focusPrevious(),o.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),br({view:this});for(const t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function fD(i){return"focusCycler"in i}class cf extends G{constructor(e){super(e),this._integrations=new Map,e.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[At]}init(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=n.isImage(t.getSelectedElement())});const o=r=>this._createToolbarComponent(r);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o)}registerIntegration({name:e,observable:t,buttonViewCreator:n,formViewCreator:o,requiresForm:r}){this._integrations.has(e)&&X("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:n,formViewCreator:o,requiresForm:!!r})}_createToolbarComponent(e){const t=this.editor,n=e.t,o=this._prepareIntegrations();if(!o.length)return null;let r;const s=o[0];if(o.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new Hr(e,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=bn(e,r),c=o.map(({observable:l})=>typeof l=="function"?l():l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=o.map(({formViewCreator:u})=>u(o.length==1)),d=new pD(t.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return X("image-insert-integrations-not-specified"),t;for(const n of e)this._integrations.has(n)?t.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||X("image-insert-unknown-integration",{item:n});return t.length||X("image-insert-integrations-not-registered"),t}}var lf=I(265),kD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(lf.A,kD),lf.A.locals;class bD extends G{static get requires(){return[sf,zo,Qp,cf]}static get pluginName(){return"ImageBlock"}}class wD extends G{static get requires(){return[uc,tf,At,rf,Ft]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,o)=>{if(n.endsWith("caption")&&o.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new nf(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,o=e.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})=>o.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,t("image widget"))}),n.for("downcast").add(us(o,"imageInline","src")).add(us(o,"imageInline","alt")).add(Zp(o,"imageInline")),n.for("upcast").elementToElement({view:Vp(e,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(o.isBlockImageView))return;l=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(l);if(dc(t.schema,d)==="imageInline"){const u=new fn(n.document),h=c.map(m=>m.childCount===1?(Array.from(m.getAttributes()).forEach(k=>u.setAttribute(...k,o.findViewImgElement(m))),m.getChild(0)):m);a.content=u.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&t.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&o.setImageNaturalSizeAttributes(d)})})}}class _D extends G{static get requires(){return[wD,zo,Qp,cf]}static get pluginName(){return"ImageInline"}}class df extends G{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[At]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),n=e.getFirstPosition().findAncestor("caption");return n&&t.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&t.isBlockImageView(e.parent)?{name:!0}:null}}class AD extends de{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),n=e.plugins.get("ImageUtils");if(!e.plugins.has(sf))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,r=o.getSelectedElement();if(!r){const s=t.getCaptionFromModelSelection(o);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(r):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=o._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||e.createElement("caption");e.append(c,s),t&&e.setSelection(c,"in")}_hideImageCaption(e){const t=this.editor,n=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),o._saveCaption(a,s),e.setSelection(a,"on"),e.remove(s)}}class CD extends G{constructor(e){super(e),this._savedCaptionsMap=new WeakMap}static get requires(){return[At,df]}static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new AD(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),r=e.t;e.conversion.for("upcast").elementToElement({view:s=>o.matchImageCaptionViewElement(s),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),e.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"),Dd({view:t,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return jm(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),r=e.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(t.isBlockImage(c)){const u=n.getCaptionFromImageModelElement(c);if(u)return void this._saveCaption(l,u)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};o&&this.listenTo(o,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Te.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{const r=t.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=o.getCaptionFromImageModelElement(a);if(!c)return;e.editing.reconvertItem(c)}}})}}class vD extends G{static get requires(){return[df]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",r=>{const s=e.commands.get("toggleImageCaption"),a=new Ae(r);return a.set({icon:oe.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>o(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(e.model.document.selection);if(c){const l=e.editing.mapper.toViewElement(c);t.scrollToTheSelection(),t.change(d=>{d.addClass("image__caption_highlighted",l)})}e.editing.view.focus()}),a})}}var uf=I(5247),yD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(uf.A,yD),uf.A.locals;function hf(i){const e=i.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function xD(i){return new Promise((e,t)=>{const n=i.getAttribute("src");fetch(n).then(o=>o.blob()).then(o=>{const r=gf(o,n),s=r.replace("image/",""),a=new File([o],`image.${s}`,{type:r});e(a)}).catch(o=>o&&o.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=w.document.createElement("img");l.addEventListener("load",()=>{const d=w.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(u=>u?a(u):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=gf(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(e).catch(t):t(o))})}function gf(i,e){return i.type?i.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class DD extends G{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=()=>{const o=this._createButton(Nh);return o.set({label:t("Upload image from computer"),tooltip:!0}),o};if(e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n),e.ui.componentFactory.add("menuBar:uploadImage",()=>{const o=this._createButton(tm);return o.label=t("Image from computer"),o}),e.plugins.has("ImageInsertUI")){const o=e.plugins.get("ImageInsertUI");o.registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>{const r=e.ui.componentFactory.create("uploadImage");return r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace image from computer":"Upload image from computer")),r},formViewCreator:()=>{const r=e.ui.componentFactory.create("uploadImage");return r.withText=!0,r.bind("label").to(o,"isImageSelected",s=>t(s?"Replace from computer":"Upload from computer")),r.on("execute",()=>{o.dropdownView.isOpen=!1}),r}})}}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=hf(r),a=new e(t.locale),c=n.t;return a.set({acceptedType:r.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:c("Upload image from computer"),icon:oe.imageUpload}),a.bind("isEnabled").to(o),a.on("done",(l,d)=>{const u=Array.from(d).filter(h=>s.test(h.type));u.length&&(t.execute("uploadImage",{file:u}),t.editing.view.focus())}),a}}var mf=I(2267),ED={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(mf.A,ED),mf.A.locals;var pf=I(7693),TD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(pf.A,TD),pf.A.locals;var ff=I(1559),MD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(ff.A,MD),ff.A.locals;class ID extends G{constructor(e){super(e),this.uploadStatusChange=(t,n,o)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!o.consumable.consume(n.item,t.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(Jt),d=a?n.attributeNewValue:null,u=this.placeholder,h=r.editing.mapper.toViewElement(s),m=o.writer;if(d=="reading")return kf(h,m),void bf(c,u,h,m);if(d=="uploading"){const k=l.loaders.get(a);return kf(h,m),void(k?(wf(h,m),function(A,E,S,O){const z=function(H){const Q=H.createUIElement("div",{class:"ck-progress-bar"});return H.setCustomProperty("progressBar",!0,Q),Q}(E);E.insert(E.createPositionAt(A,"end"),z),S.on("change:uploadedPercent",(H,Q,ne)=>{O.change(se=>{se.setStyle("width",ne+"%",z)})})}(h,m,k,r.editing.view),function(A,E,S,O){if(O.data){const z=A.findViewImgElement(E);S.setAttribute("src",O.data,z)}}(c,h,m,k)):bf(c,u,h,m))}d=="complete"&&l.loaders.get(a)&&function(k,A,E){const S=A.createUIElement("div",{class:"ck-image-upload-complete-icon"});A.insert(A.createPositionAt(k,"end"),S),setTimeout(()=>{E.change(O=>O.remove(O.createRangeOn(S)))},3e3)}(h,m,r.editing.view),function(k,A){Af(k,A,"progressBar")}(h,m),wf(h,m),function(k,A){A.removeClass("ck-appear",k)}(h,m)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function kf(i,e){i.hasClass("ck-appear")||e.addClass("ck-appear",i)}function bf(i,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const o=i.findViewImgElement(t);o.getAttribute("src")!==e&&n.setAttribute("src",e,o),_f(t,"placeholder")||n.insert(n.createPositionAfter(o),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function wf(i,e){i.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",i),Af(i,e,"placeholder")}function _f(i,e){for(const t of i.getChildren())if(t.getCustomProperty(e))return t}function Af(i,e,t){const n=_f(i,t);n&&e.remove(e.createRangeOn(n))}var SD=Object.defineProperty,BD=Object.defineProperties,ND=Object.getOwnPropertyDescriptors,Cf=Object.getOwnPropertySymbols,OD=Object.prototype.hasOwnProperty,PD=Object.prototype.propertyIsEnumerable,vf=(i,e,t)=>e in i?SD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;class LD extends de{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Oe(e.file),n=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&o.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(e,t,n){const o=this.editor,r=o.plugins.get(Jt).createLoader(e),s=o.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var u in d||(d={}))OD.call(d,u)&&vf(l,u,d[u]);if(Cf)for(var u of Cf(d))PD.call(d,u)&&vf(l,u,d[u]);return l})({},t),c={uploadId:r.id},BD(a,ND(c))),n)}}class zD extends G{constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Jt,$a,Ft,At]}static get pluginName(){return"ImageUploadEditing"}init(){const e=this.editor,t=e.model.document,n=e.conversion,o=e.plugins.get(Jt),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=hf(e.config.get("image.upload.types")),c=new LD(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(l,d)=>{if(u=d.dataTransfer,Array.from(u.types).includes("text/html")&&u.getData("text/html")!=="")return;var u;const h=Array.from(d.dataTransfer.files).filter(m=>!!m&&a.test(m.type));h.length&&(l.stop(),e.model.change(m=>{d.targetRanges&&m.setSelection(d.targetRanges.map(k=>e.editing.mapper.toModelRange(k))),e.execute("uploadImage",{file:h})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const u=Array.from(e.editing.view.createRangeIn(d.content)).map(m=>m.item).filter(m=>function(k,A){return!(!k.isInlineImageView(A)||!A.getAttribute("src")||!A.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!A.getAttribute("src").match(/^blob:/g))}(r,m)&&!m.getAttribute("uploadProcessed")).map(m=>({promise:xD(m),imageElement:m}));if(!u.length)return;const h=new fn(e.editing.view.document);for(const m of u){h.setAttribute("uploadProcessed",!0,m.imageElement);const k=o.createLoader(m.promise);k&&(h.setAttribute("src","",m.imageElement),h.setAttribute("uploadId",k.id,m.imageElement))}}),e.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),t.on("change",()=>{const l=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const u of l)if(u.type=="insert"&&u.name!="$text"){const h=u.position.nodeAfter,m=u.position.root.rootName=="$graveyard";for(const k of RD(e,h)){const A=k.getAttribute("uploadId");if(!A)continue;const E=o.loaders.get(A);E&&(m?d.has(A)||E.abort():(d.add(A),this._uploadImageElements.set(A,k),E.status=="idle"&&this._readAndUpload(E)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:u})=>{const h=u.urls?u.urls:u;this.editor.model.change(m=>{m.setAttribute("src",h.default,d),this._parseAndSetSrcsetAttributeOnImage(h,d,m),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,o=t.locale.t,r=t.plugins.get(Jt),s=t.plugins.get($a),a=t.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(e.id))}),e.read().then(()=>{const d=e.upload(),u=c.get(e.id);if(x.isSafari){const h=t.editing.mapper.toViewElement(u),m=a.findViewImgElement(h);t.editing.view.once("render",()=>{if(!m.parent)return;const k=t.editing.view.domConverter.mapViewToDom(m.parent);if(!k)return;const A=k.style.display;k.style.display="none",k._ckHack=k.offsetHeight,k.style.display=A})}return t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image")),n.enqueueChange({isUndoable:!1},h=>{h.setAttribute("uploadStatus","uploading",u)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},u=>{const h=c.get(e.id);u.setAttribute("uploadStatus","complete",h),t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this.fire("uploadComplete",{data:d,imageElement:h})}),l()}).catch(d=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw d;e.status=="error"&&d&&s.showWarning(d,{title:o("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},u=>{u.remove(c.get(e.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const u=c.get(e.id);d.removeAttribute("uploadId",u),d.removeAttribute("uploadStatus",u),c.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let o=0;const r=Object.keys(e).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return o=Math.max(o,a),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};t.hasAttribute("width")||t.hasAttribute("height")||(s.width=o),n.setAttributes(s,t)}}}function RD(i,e){const t=i.plugins.get("ImageUtils");return Array.from(i.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}var yf=I(4642),jD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(yf.A,jD),yf.A.locals;var xf=I(3469),FD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(xf.A,FD),xf.A.locals;class VD extends de{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const o of n.modelElements)this._defaultStyles[o]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,o=t.plugins.get("ImageUtils");n.change(r=>{const s=e.value,{setImageSizes:a=!0}=e;let c=o.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(o.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=o.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&o.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}var HD=Object.defineProperty,Df=Object.getOwnPropertySymbols,UD=Object.prototype.hasOwnProperty,WD=Object.prototype.propertyIsEnumerable,Ef=(i,e,t)=>e in i?HD(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Tf=(i,e)=>{for(var t in e||(e={}))UD.call(e,t)&&Ef(i,t,e[t]);if(Df)for(var t of Df(e))WD.call(e,t)&&Ef(i,t,e[t]);return i};const{objectFullWidth:qD,objectInline:Mf,objectLeft:If,objectRight:hc,objectCenter:gc,objectBlockLeft:Sf,objectBlockRight:Bf}=oe,gs={get inline(){return{name:"inline",title:"In line",icon:Mf,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:If,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Sf,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:gc,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:hc,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Bf,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:gc,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:hc,modelElements:["imageBlock"],className:"image-style-side"}}},Nf={full:qD,left:Sf,right:Bf,center:gc,inlineLeft:If,inlineRight:hc,inline:Mf},Of=[{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 Pf(i){X("image-style-configuration-definition-invalid",i)}const mc={normalizeStyles:function(i){return(i.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?gs[t]?Tf({},gs[t]):{name:t}:function(n,o){const r=Tf({},o);for(const s in n)Object.prototype.hasOwnProperty.call(o,s)||(r[s]=n[s]);return r}(gs[t.name],t),typeof t.icon=="string"&&(t.icon=Nf[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:o}){const{modelElements:r,name:s}=t;if(!(r&&r.length&&s))return Pf({style:t}),!1;{const a=[n?"imageBlock":null,o?"imageInline":null];if(!r.some(c=>a.includes(c)))return X("image-style-missing-dependency",{style:t,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,i))},getDefaultStylesConfiguration:function(i,e){return i&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:i?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(i){return i.has("ImageBlockEditing")&&i.has("ImageInlineEditing")?[...Of]:[]},warnInvalidStyle:Pf,DEFAULT_OPTIONS:gs,DEFAULT_ICONS:Nf,DEFAULT_DROPDOWN_DEFINITIONS:Of};function Lf(i,e){for(const t of e)if(t.name===i)return t}class zf extends G{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[At]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=mc,n=this.editor,o=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(o,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:r}),this._setupConversion(o,r),this._setupPostFixer(),n.commands.add("imageStyle",new VD(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,o=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const u=Lf(l.attributeNewValue,s),h=Lf(l.attributeOldValue,s),m=d.mapper.toViewElement(l.item),k=d.writer;h&&k.removeClass(h.className,m),u&&k.addClass(u.className,m)});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,u,h)=>{if(!u.modelRange)return;const m=u.viewItem,k=at(u.modelRange.getItems());if(k&&h.schema.checkAttribute(k,"imageStyle"))for(const A of l[k.name])h.consumable.consume(m,{classes:A.className})&&h.writer.setAttribute("imageStyle",A.name,k)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(At),o=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let s=!1;for(const a of t.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=o.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Rf=I(6386),GD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Rf.A,GD),Rf.A.locals;class $D extends G{static get requires(){return[zf]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=jf(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const o=jf([...t.filter(he),...mc.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of o)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,o=>{let r;const{defaultItem:s,items:a,title:c}=e,l=a.filter(m=>t.find(({name:k})=>Ff(k)===m)).map(m=>{const k=n.create(m);return m===s&&(r=k),k});a.length!==l.length&&mc.warnInvalidStyle({dropdown:e});const d=bn(o,Hr),u=d.buttonView,h=u.arrowView;return Ha(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:Vf(c,r.label),class:null,tooltip:!0}),h.unbind("label"),h.set({label:c}),u.bind("icon").toMany(l,"isOn",(...m)=>{const k=m.findIndex(In);return k<0?r.icon:l[k].icon}),u.bind("label").toMany(l,"isOn",(...m)=>{const k=m.findIndex(In);return Vf(c,k<0?r.label:l[k].label)}),u.bind("isOn").toMany(l,"isOn",(...m)=>m.some(In)),u.bind("class").toMany(l,"isOn",(...m)=>m.some(In)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{l.some(({isOn:m})=>m)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...m)=>m.some(In)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Ff(t),n=>{const o=this.editor.commands.get("imageStyle"),r=new Ae(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",s=>s===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function jf(i,e){for(const t of i)e[t.title]&&(t.title=e[t.title]);return i}function Ff(i){return`imageStyle:${i}`}function Vf(i,e){return(i?i+": ":"")+e}class KD extends G{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new _d(e)),e.commands.add("outdent",new _d(e))}}class YD extends G{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,o=t.uiLanguageDirection=="ltr"?oe.indent:oe.outdent,r=t.uiLanguageDirection=="ltr"?oe.outdent:oe.indent;this._defineButton("indent",n("Increase indent"),o),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,()=>{const r=this._createButton(Ae,e,t,n);return r.set({tooltip:!0}),r}),o.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(It,e,t,n))}_createButton(e,t,n,o){const r=this.editor,s=r.commands.get(t),a=new e(r.locale);return a.set({label:n,icon:o}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{r.execute(t),r.editing.view.focus()}),a}}class QD{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,o)=>{if(!o.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!o.schema.isInline(n.item))return;const r=o.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(o.mapper.toViewRange(n.range),c):r.unwrap(o.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:o,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=sn(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,u]of l)d==="class"?o.addClass(u,a):o.setAttribute(d,u,a);c.classes&&o.addClass(c.classes,a);for(const d in c.styles)o.setStyle(d,c.styles[d],a)}else{for(const[d,u]of l)d==="class"?o.removeClass(u,a):o.removeAttribute(d,a);c.classes&&o.removeClass(c.classes,a);for(const d in c.styles)o.removeStyle(d,a)}}})}}}const ZD=function(i,e,t){var n=i.length;return t=t===void 0?n:t,!e&&t>=n?i:Bd(i,e,t)};var JD=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Hf=function(i){return JD.test(i)},XD=function(i){return i.split("")};var Uf="\\ud800-\\udfff",eE="["+Uf+"]",pc="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",fc="\\ud83c[\\udffb-\\udfff]",Wf="[^"+Uf+"]",qf="(?:\\ud83c[\\udde6-\\uddff]){2}",Gf="[\\ud800-\\udbff][\\udc00-\\udfff]",$f="(?:"+pc+"|"+fc+")?",Kf="[\\ufe0e\\ufe0f]?",tE=Kf+$f+("(?:\\u200d(?:"+[Wf,qf,Gf].join("|")+")"+Kf+$f+")*"),nE="(?:"+[Wf+pc+"?",pc,qf,Gf,eE].join("|")+")",iE=RegExp(fc+"(?="+fc+")|"+nE+tE,"g");const oE=function(i){return i.match(iE)||[]},rE=function(i){return Hf(i)?oE(i):XD(i)},sE=function(i){return function(e){e=ra(e);var t=Hf(e)?rE(e):void 0,n=t?t[0]:e.charAt(0),o=t?ZD(t,1).join(""):e.slice(1);return n[i]()+o}}("toUpperCase"),aE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,cE=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,lE=/^((\w+:(\/{2,})?)|(\W))/i,dE=["https?","ftps?","mailto"],ms="Ctrl+K";function Yf(i,{writer:e}){const t=e.createAttributeElement("a",{href:i},{priority:5});return e.setCustomProperty("link",!0,t),t}function Qf(i,e=dE){const t=String(i),n=e.join("|");return function(o,r){return!!o.replace(aE,"").match(r)}(t,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?t:"#"}function kc(i,e){return!!i&&e.checkAttribute(i.name,"linkHref")}function bc(i,e){const t=(n=i,cE.test(n)?"mailto:":e);var n;const o=!!t&&!Zf(i);return i&&o?t+i:i}function Zf(i){return lE.test(i)}function Jf(i){window.open(i,"_blank","noopener")}class uE extends de{constructor(){super(...arguments),this.manualDecorators=new qt,this.automaticDecorators=new QD}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||at(t.getSelectedBlocks());kc(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(e,t={}){const n=this.editor.model,o=n.document.selection,r=[],s=[];for(const a in t)t[a]?r.push(a):s.push(a);n.change(a=>{if(o.isCollapsed){const c=o.getFirstPosition();if(o.hasAttribute("linkHref")){const l=Xf(o);let d=es(c,"linkHref",o.getAttribute("linkHref"),n);o.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,e)),a.setAttribute("linkHref",e,d),r.forEach(u=>{a.setAttribute(u,!0,d)}),s.forEach(u=>{a.removeAttribute(u,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(e!==""){const l=sn(o.getAttributes());l.set("linkHref",e),r.forEach(u=>{l.set(u,!0)});const{end:d}=n.insertContent(a.createText(e,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(o.getRanges(),"linkHref"),l=[];for(const u of o.getSelectedBlocks())n.schema.checkAttribute(u,"linkHref")&&l.push(a.createRangeOn(u));const d=l.slice();for(const u of c)this._isRangeToUpdate(u,l)&&d.push(u);for(const u of d){let h=u;if(d.length===1){const m=Xf(o);o.getAttribute("linkHref")===m&&(h=this._updateLinkContent(n,a,u,e),a.setSelection(a.createSelection(h)))}a.setAttribute("linkHref",e,h),r.forEach(m=>{a.setAttribute(m,!0,h)}),s.forEach(m=>{a.removeAttribute(m,h)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,o=n.getSelectedElement();return kc(o,t.schema)?o.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}_updateLinkContent(e,t,n,o){const r=t.createText(o,{linkHref:o});return e.insertContent(r,n)}}function Xf(i){if(i.isCollapsed){const e=i.getFirstPosition();return e.textNode&&e.textNode.data}{const e=Array.from(i.getFirstRange().getItems());if(e.length>1)return null;const t=e[0];return t.is("$text")||t.is("$textProxy")?t.data:null}}class hE extends de{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kc(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,o=e.commands.get("link");t.change(r=>{const s=n.isCollapsed?[es(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),o)for(const c of o.manualDecorators)r.removeAttribute(c.id,a)})}}class gE extends xe(){constructor({id:e,label:t,attributes:n,classes:o,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=n,this.classes=o,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var ek=I(7719),mE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(ek.A,mE),ek.A.locals;var pE=Object.defineProperty,tk=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,nk=(i,e,t)=>e in i?pE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bE=(i,e)=>{for(var t in e||(e={}))fE.call(e,t)&&nk(i,t,e[t]);if(tk)for(var t of tk(e))kE.call(e,t)&&nk(i,t,e[t]);return i};const ik="automatic",wE=/^(https?:)?\/\//;class ok extends G{static get pluginName(){return"LinkEditing"}static get requires(){return[Tm,Am,Ft]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Yf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,r)=>Yf(Qf(o,t),r)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new uE(e)),e.commands.add("unlink",new hE(e));const n=function(o,r){const s={"Open in a new tab":o("Open in a new tab"),Downloadable:o("Downloadable")};return r.forEach(a=>("label"in a&&s[a.label]&&(a.label=s[a.label]),a)),r}(e.t,function(o){const r=[];if(o)for(const[s,a]of Object.entries(o)){const c=Object.assign({},a,{id:`link${sE(s)}`});r.push(c)}return r}(e.config.get("link.decorators")));this._enableAutomaticDecorators(n.filter(o=>o.mode===ik)),this._enableManualDecorators(n.filter(o=>o.mode==="manual")),e.plugins.get(Tm).registerAttribute("linkHref"),function(o,r,s,a){const c=o.editing.view,l=new Set;c.document.registerPostFixer(d=>{const u=o.model.document.selection;let h=!1;if(u.hasAttribute(r)){const m=es(u.getFirstPosition(),r,u.getAttribute(r),o.model),k=o.editing.mapper.toViewRange(m);for(const A of k.getItems())A.is("element",s)&&!A.hasClass(a)&&(d.addClass(a,A),l.add(A),h=!0)}return h}),o.conversion.for("editingDowncast").add(d=>{function u(){c.change(h=>{for(const m of l.values())h.removeClass(a,m),l.delete(m)})}d.on("insert",u,{priority:"highest"}),d.on("remove",u,{priority:"highest"}),d.on("attribute",u,{priority:"highest"}),d.on("selection",u,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:ik,callback:o=>!!o&&wE.test(o),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(o=>{t.model.schema.extend("$text",{allowAttributes:o.id});const r=new gE(o);n.add(r),t.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 u in r.styles)a.setStyle(u,r.styles[u],d);return a.setCustomProperty("link",!0,d),d}}}),t.conversion.for("upcast").elementToAttribute({view:bE({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(n,o)=>{if(!(x.isMac?o.domEvent.metaKey:o.domEvent.ctrlKey))return;let r=o.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),o.preventDefault(),Jf(s))},{context:"$capture"}),this.listenTo(t,"keydown",(n,o)=>{const r=e.commands.get("link").value;r&&o.keyCode===ke.enter&&o.altKey&&(n.stop(),Jf(r))})}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(n,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=e.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const e=this.editor,t=e.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(o,r)=>{t.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=bc(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var rk=I(3817),_E={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(rk.A,_E),rk.A.locals;class AE extends te{constructor(e,t,n){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt;const o=e.t;this._validators=n,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(o("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(o("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),br({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Fr(this.locale,Ur);return t.label=e("Link URL"),t}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const o=new Rr(this.locale);o.set({name:n.id,label:n.label,withText:!0}),o.bind("isOn").toMany([n,e],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),o.on("execute",()=>{n.set("value",!o.isOn)}),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new te;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(o=>({tag:"li",children:[o],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var sk=I(8762),CE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(sk.A,CE),sk.A.locals;class vE extends te{constructor(e,t={}){super(e),this.focusTracker=new ct,this.keystrokes=new ft,this._focusables=new zt;const n=e.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),oe.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new jt({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(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new Ae(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const e=new Ae(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",o=>o&&Qf(o,this._linkConfig.allowedProtocols)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",o=>o||n("This link has no URL")),e.bind("isEnabled").to(this,"href",o=>!!o),e.template.tag="a",e.template.eventListeners={},e}}const un="link-ui";class yE extends G{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Yr]}static get pluginName(){return"LinkUI"}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(kv),this._balloon=e.plugins.get(Yr),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:un,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:un,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:ms},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}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 e=this.editor,t=new vE(e.locale,e.config.get("link")),n=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),t.keystrokes.set(ms,(r,s)=>{this._addFormView(),s()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),o=new(ea(AE))(e.locale,t,function(r){const s=r.t,a=r.config.get("link.allowCreatingEmptyLinks");return[c=>{if(!a&&!c.url.length)return s("Link URL must not be empty.")}]}(e));return o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.bind("isEnabled").to(t,"isEnabled"),o.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(o,"submit",()=>{if(o.isValid()){const{value:r}=o.urlInputView.fieldView.element,s=bc(r,n);e.execute("link",s,o.getDecoratorSwitchesState()),this._closeFormView()}}),this.listenTo(o.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(r,s)=>{this._closeFormView(),s()}),o}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link");e.ui.componentFactory.add("link",()=>{const n=this._createButton(Ae);return n.set({tooltip:!0,isToggleable:!0}),n.bind("isOn").to(t,"value",o=>!!o),n}),e.ui.componentFactory.add("menuBar:link",()=>this._createButton(It))}_createButton(e){const t=this.editor,n=t.locale,o=t.commands.get("link"),r=new e(t.locale),s=n.t;return r.set({label:s("Link"),icon:'',keystroke:ms}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>this._showUI(!0)),r}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(ms,(n,o)=>{o(),e.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),kr({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 e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.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(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),o=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,o=c};function s(){return t.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(e.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 e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let o;if(t.markers.has(un)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(un)),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));o=e.domConverter.viewRangeToDom(s)}else o=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&et(n))return wc(t.getFirstPosition());{const o=t.getFirstRange().getTrimmed(),r=wc(o.start),s=wc(o.end);return r&&r==s&&e.createRangeIn(r).getTrimmed().isEqual(o)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(un))t.updateMarker(un,{range:n});else if(n.start.isAtEnd){const o=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker(un,{usingOperation:!1,affectsData:!1,range:t.createRange(o,n.end)})}else t.addMarker(un,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(un)&&e.change(t=>{t.removeMarker(un)})}}function wc(i){return i.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})||null}const ak=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 xE extends G{static get requires(){return[_n,ok]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?es(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const n=this.editor.model,o=n.document.selection,r=o.getFirstPosition(),s=o.getLastPosition();let a=t.getJoined(this._expandLinkRange(n,r)||t);a&&(a=a.getJoined(this._expandLinkRange(n,s)||t)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&e.setSelection(a)}_enablePasteLinking(){const e=this.editor,t=e.model,n=t.document.selection,o=e.plugins.get("ClipboardPipeline"),r=e.commands.get("link");o.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(ak);d&&d[2]===l&&(t.change(u=>{this._selectEntireLinks(u,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Em(e.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const o=ck(n.substr(0,n.length-1));return o?{url:o}:void 0});t.on("matched:data",(n,o)=>{const{batch:r,range:s,url:a}=o;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=e.model.createRange(l,c);this._applyAutoLink(a,d)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition();if(!o.parent.previousSibling)return;const r=t.createRangeIn(o.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const o=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(o.parent,0),o.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:o}=Dm(e,t),r=ck(n);if(r){const s=t.createRange(o.end.getShiftedBy(-r.length),o.end);this._applyAutoLink(r,s)}}_applyAutoLink(e,t){const n=this.editor.model,o=bc(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(t,n)&&Zf(o)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const n=this.editor.model,o=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",e,t),n.enqueueChange(()=>{o.requestUndoOnBackspace()})})}}function ck(i){const e=ak.exec(i);return e?e[2]:null}var lk=I(4808),DE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(lk.A,DE),lk.A.locals;class Ht{constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward=t.direction=="forward",this._includeSelf=!!t.includeSelf,this._sameAttributes=Oe(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return at(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of Fo(this._getStartNode(),this._isForward?"forward":"backward")){const n=t.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(o=>t.getAttribute(o)!==this._startElement.getAttribute(o)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*Fo(i,e="forward"){const t=e=="forward",n=[];let o=null;for(;rt(i);){let r=null;if(o){const s=i.getAttribute("listIndent"),a=o.getAttribute("listIndent");s>a?n[a]=o:se in i?TE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Vo=(i,e)=>{for(var t in e||(e={}))SE.call(e,t)&&uk(i,t,e[t]);if(dk)for(var t of dk(e))BE.call(e,t)&&uk(i,t,e[t]);return i},_c=(i,e)=>ME(i,IE(e));class Ui{static next(){return $()}}function rt(i){return!!i&&i.is("element")&&i.hasAttribute("listItemId")}function Ac(i,e={}){return[...Ln(i,_c(Vo({},e),{direction:"backward"})),...Ln(i,_c(Vo({},e),{direction:"forward"}))]}function Ln(i,e={}){const t=e.direction=="forward",n=Array.from(new Ht(i,_c(Vo({},e),{includeSelf:t,sameIndent:!0,sameAttributes:"listItemId"})));return t?n:n.reverse()}function hk(i,e){const t=new Ht(i,Vo({sameIndent:!0,sameAttributes:"listType"},e)),n=new Ht(i,Vo({sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"},e));return[...Array.from(t).reverse(),...n]}function ni(i){return!Ht.first(i,{sameIndent:!0,sameAttributes:"listItemId"})}function gk(i){return!Ht.first(i,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function Ho(i,e={}){i=Oe(i);const t=e.withNested!==!1,n=new Set;for(const o of i)for(const r of Ac(o,{higherIndent:t}))n.add(r);return ii(n)}function NE(i){i=Oe(i);const e=new Set;for(const t of i)for(const n of hk(t))e.add(n);return ii(e)}function Cc(i,e){const t=Ln(i,{direction:"forward"}),n=Ui.next();for(const o of t)e.setAttribute("listItemId",n,o);return t}function vc(i,e,t){const n={};for(const[r,s]of e.getAttributes())r.startsWith("list")&&(n[r]=s);const o=Ln(i,{direction:"forward"});for(const r of o)t.setAttributes(n,r);return o}function yc(i,e,{expand:t,indentBy:n=1}={}){i=Oe(i);const o=t?Ho(i):i;for(const r of o){const s=r.getAttribute("listIndent")+n;s<0?ps(r,e):e.setAttribute("listIndent",s,r)}return o}function ps(i,e){i=Oe(i);for(const t of i)t.is("element","listItem")&&e.rename(t,"paragraph");for(const t of i)for(const n of t.getAttributeKeys())n.startsWith("list")&&e.removeAttribute(n,t);return i}function Uo(i){if(!i.length)return!1;const e=i[0].getAttribute("listItemId");return!!e&&!i.some(t=>t.getAttribute("listItemId")!=e)}function ii(i){return Array.from(i).filter(e=>e.root.rootName!=="$graveyard").sort((e,t)=>e.index-t.index)}function Wo(i){const e=i.document.selection.getSelectedElement();return e&&i.schema.isObject(e)&&i.schema.isBlock(e)?e:null}function xc(i,e){return e.checkChild(i.parent,"listItem")&&e.checkChild(i,"$text")&&!e.isObject(i)}function OE(i){return i=="numbered"||i=="customNumbered"}function PE(i,e,t){return Ln(e,{direction:"forward"}).pop().index>i.index?vc(i,e,t):[]}class mk extends de{constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=pk(e.document.selection);e.change(n=>{const o=[];Uo(t)&&!ni(t[0])?(this._direction=="forward"&&o.push(...yc(t,n)),o.push(...Cc(t[0],n))):this._direction=="forward"?o.push(...yc(t,n,{expand:!0})):o.push(...function(r,s){const a=Ho(r=Oe(r)),c=new Set,l=Math.min(...a.map(u=>u.getAttribute("listIndent"))),d=new Map;for(const u of a)d.set(u,Ht.first(u,{lowerIndent:!0}));for(const u of a){if(c.has(u))continue;c.add(u);const h=u.getAttribute("listIndent")-1;if(h<0)ps(u,s);else{if(u.getAttribute("listIndent")==l){const m=PE(u,d.get(u),s);for(const k of m)c.add(k);if(m.length)continue}s.setAttribute("listIndent",h,u)}}return ii(c)}(t,n));for(const r of o){if(!r.hasAttribute("listType"))continue;const s=Ht.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(o)})}_fireAfterExecute(e){this.fire("afterExecute",ii(new Set(e)))}_checkEnabled(){let e=pk(this.editor.model.document.selection),t=e[0];if(!t)return!1;if(this._direction=="backward"||Uo(e)&&!ni(e[0]))return!0;e=Ho(e),t=e[0];const n=Ht.first(t,{sameIndent:!0});return!!n&&n.getAttribute("listType")==t.getAttribute("listType")}}function pk(i){const e=Array.from(i.getSelectedBlocks()),t=e.findIndex(n=>!rt(n));return t!=-1&&(e.length=t),e}var LE=Object.defineProperty,zE=Object.defineProperties,RE=Object.getOwnPropertyDescriptors,fk=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,kk=(i,e,t)=>e in i?LE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Dc=(i,e)=>{for(var t in e||(e={}))jE.call(e,t)&&kk(i,t,e[t]);if(fk)for(var t of fk(e))FE.call(e,t)&&kk(i,t,e[t]);return i},Ec=(i,e)=>zE(i,RE(e));class fs extends de{constructor(e,t,n={}){super(e),this.type=t,this._listWalkerOptions=n.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,o=Wo(t),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>t.schema.checkAttribute(a,"listType")||xc(a,t.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(s){const c=r[r.length-1],l=Ln(c,{direction:"forward"}),d=[];l.length>1&&d.push(...Cc(l[1],a)),d.push(...ps(r,a)),d.push(...function(u,h){const m=[];let k=Number.POSITIVE_INFINITY;for(const{node:A}of Fo(u.nextSibling,"forward")){const E=A.getAttribute("listIndent");if(E==0)break;E{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,e),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const h=(u=a,Array.from(new Ht(u,{direction:"forward",higherIndent:!0})));o.push(...yc([a,...h],r,{indentBy:c-l,expand:c{const t=Cc(this._getStartBlock(),e);this._fireAfterExecute(t)})}_fireAfterExecute(e){this.fire("afterExecute",ii(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&rt(t)&&!ni(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}}class VE extends G{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(e){return NE(e)}isFirstBlockOfListItem(e){return ni(e)}isListItemBlock(e){return rt(e)}expandListBlocksToCompleteItems(e,t={}){return Ho(e,t)}isNumberedListType(e){return OE(e)}}function _k(i){return i.is("element","ol")||i.is("element","ul")}function ks(i){return i.is("element","li")}function HE(i,e,t,n=Ck(t,e)){return i.createAttributeElement(Ak(t),null,{priority:2*e/100-100,id:n})}function UE(i,e,t){return i.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:t})}function Ak(i){return i=="numbered"||i=="customNumbered"?"ol":"ul"}function Ck(i,e){return`list-${i}-${e}`}function Xt(i,e){const t=i.nodeBefore;if(rt(t)){let n=t;for(const{node:o}of Fo(n,"backward"))if(n=o,e.has(n))return;e.set(t,n)}else{const n=i.nodeAfter;rt(n)&&e.set(n,n)}}function WE(){return(i,e,t)=>{const{writer:n,schema:o}=t;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter(u=>o.checkAttribute(u,"listItemId"));if(!r.length)return;const s=Ui.next(),a=function(u){let h=0,m=u.parent;for(;m;){if(ks(m))h++;else{const k=m.previousSibling;k&&ks(k)&&h++}m=m.parent}return h}(e.viewItem);let c=e.viewItem.parent&&e.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 u of r)u.hasAttribute("listItemId")||n.setAttributes(d,u);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&t.keepEmptyElement(r[0])}}function vk(){return(i,e,t)=>{if(!t.consumable.test(e.viewItem,{name:!0}))return;const n=new fn(e.viewItem.document);for(const o of Array.from(e.viewItem.getChildren()))ks(o)||_k(o)||n.remove(o)}}function yk(i,e,t,{dataPipeline:n}={}){const o=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)}}(i);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,u=s.item;if(!i.includes(s.attributeKey)||!o(u,d))return;const h=function(k,A,E){const S=E.createRangeOn(k);return A.toViewRange(S).getTrimmed().end.nodeBefore}(u,l,t);Dk(h,c,l),function(k,A){let E=k.parent;for(;E.is("attributeElement")&&["ul","ol","li"].includes(E.name);){const S=E.parent;A.unwrap(A.createRangeOn(k),E),E=S}}(h,c);const m=function(k,A,E,S,{dataPipeline:O}){let z=S.createRangeOn(A);if(!ni(k))return z;for(const H of E){if(H.scope!="itemMarker")continue;const Q=H.createElement(S,k,{dataPipeline:O});if(!Q||(S.setCustomProperty("listItemMarker",!0,Q),H.canInjectMarkerIntoElement&&H.canInjectMarkerIntoElement(k)?S.insert(S.createPositionAt(A,0),Q):(S.insert(z.start,Q),z=S.createRange(S.createPositionBefore(Q),S.createPositionAfter(A))),!H.createWrapperElement||!H.canWrapElement))continue;const ne=H.createWrapperElement(S,k,{dataPipeline:O});S.setCustomProperty("listItemWrapper",!0,ne),H.canWrapElement(k)?z=S.wrap(z,ne):(z=S.wrap(S.createRangeOn(Q),ne),z=S.createRange(z.start,S.createPositionAfter(A)))}return z}(u,h,e,c,{dataPipeline:n});(function(k,A,E,S){if(!k.hasAttribute("listIndent"))return;const O=k.getAttribute("listIndent");let z=k;for(let H=O;H>=0;H--){const Q=UE(S,H,z.getAttribute("listItemId")),ne=HE(S,H,z.getAttribute("listType"));for(const se of E)se.scope!="list"&&se.scope!="item"||!z.hasAttribute(se.attributeName)||se.setAttributeOnDowncast(S,z.getAttribute(se.attributeName),se.scope=="list"?ne:Q);if(A=S.wrap(A,Q),A=S.wrap(A,ne),H==0||(z=Ht.first(z,{lowerIndent:!0}),!z))break}})(u,m,e,c)}}function xk(i,{dataPipeline:e}={}){return(t,{writer:n})=>{if(!Ek(t,i))return null;if(!e)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const o=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}function Dk(i,e,t){for(;i.parent.is("attributeElement")&&i.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(i),i.parent);const n=[];o(e.createPositionBefore(i).getWalker({direction:"backward"})),o(e.createRangeIn(i).getWalker());for(const r of n)e.remove(r);function o(r){for(const{item:s}of r){if(s.is("element")&&t.toModelElement(s))break;s.is("element")&&s.getCustomProperty("listItemMarker")&&n.push(s)}}}function Ek(i,e,t=Ac(i)){if(!rt(i))return!1;for(const n of i.getAttributeKeys())if(!n.startsWith("selection:")&&!e.includes(n))return!1;return t.length<2}var Tk=I(1232),qE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Tk.A,qE),Tk.A.locals;var Mk=I(6903),GE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Mk.A,GE),Mk.A.locals;const bs=["listType","listIndent","listItemId"];class $E extends G{constructor(e){super(e),this._downcastStrategies=[],e.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[ts,_n,VE,Ft]}init(){const e=this.editor,t=e.model,n=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new B("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:bs}),n?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const o of bs)t.schema.setAttributeProperties(o,{copyOnReplace:!0});e.commands.add("numberedList",new fs(e,"numbered")),e.commands.add("bulletedList",new fs(e,"bulleted")),e.commands.add("customNumberedList",new fs(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new fs(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new mk(e,"forward")),e.commands.add("outdentList",new mk(e,"backward")),e.commands.add("splitListItemBefore",new wk(e,"before")),e.commands.add("splitListItemAfter",new wk(e,"after")),n&&(e.commands.add("mergeListItemBackward",new bk(e,"backward")),e.commands.add("mergeListItemForward",new bk(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...bs,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),n=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(o,r)=>{const s=e.model.document.selection;Wo(e.model)||e.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!rt(c))return;if(Ht.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:Ik(e.model,"backward")})}else gk(c)||e.execute("splitListItemAfter"),e.execute("outdentList");r.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:Ik(e.model,"forward")}),r.preventDefault(),o.stop()}})},{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,n=e.commands,o=n.get("enter");this.listenTo(e.editing.view.document,"enter",(r,s)=>{const a=t.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&rt(c)&&c.isEmpty&&!s.isSoft){const l=ni(c),d=gk(c);l&&d?(e.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(e.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(e.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(o,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&Ac(e.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,n)=>{const o=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,n=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),r=o?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:d})=>d.createElement(r,{listType:""})}).elementToElement({view:"p",model:(l,{writer:d})=>l.parent&&l.parent.is("element","li")?d.createElement(r,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",WE()),l.on("element:ul",vk(),{priority:"high"}),l.on("element:ol",vk(),{priority:"high"})}),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:r,view:xk(n),converterPriority:"high"}).add(l=>{var d;l.on("attribute",yk(n,this._downcastStrategies,t)),l.on("remove",(d=t.schema,(u,h,m)=>{const{writer:k,mapper:A}=m,E=u.name.split(":")[1];if(!d.checkAttribute(E,"listItemId"))return;const S=A.toViewPosition(h.position),O=h.position.getShiftedBy(h.length),z=A.toViewPosition(O,{isPhantom:!0}),H=k.createRange(S,z).getTrimmed().end.nodeBefore;H&&Dk(H,k,A)}))}),e.conversion.for("dataDowncast").elementToElement({model:r,view:xk(n,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",yk(n,this._downcastStrategies,t,{dataPipeline:!0}))});const s=(a=this._downcastStrategies,c=e.editing.view,(l,d)=>{if(d.modelPosition.offset>0)return;const u=d.modelPosition.parent;if(!rt(u)||!a.some(E=>E.scope=="itemMarker"&&E.canInjectMarkerIntoElement&&E.canInjectMarkerIntoElement(u)))return;const h=d.mapper.toViewElement(u),m=c.createRangeIn(h),k=m.getWalker();let A=m.start;for(const{item:E}of k){if(E.is("element")&&d.mapper.toModelElement(E)||E.is("$textProxy"))break;E.is("element")&&E.getCustomProperty("listItemMarker")&&(A=c.createPositionAfter(E),k.skip(({previousPosition:S})=>!S.isEqual(A)))}d.viewPosition=A});var a,c;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",function(l,d,u,h){return()=>{const E=l.document.differ.getChanges(),S=[],O=new Map,z=new Set;for(const H of E)if(H.type=="insert"&&H.name!="$text")Xt(H.position,O),H.attributes.has("listItemId")?z.add(H.position.nodeAfter):Xt(H.position.getShiftedBy(H.length),O);else if(H.type=="remove"&&H.attributes.has("listItemId"))Xt(H.position,O);else if(H.type=="attribute"){const Q=H.range.start.nodeAfter;u.includes(H.attributeKey)?(Xt(H.range.start,O),H.attributeNewValue===null?(Xt(H.range.start.getShiftedBy(1),O),k(Q)&&S.push(Q)):z.add(Q)):rt(Q)&&k(Q)&&S.push(Q)}for(const H of O.values())S.push(...m(H,z));for(const H of new Set(S))d.reconvertItem(H)};function m(E,S){const O=[],z=new Set,H=[];for(const{node:Q,previous:ne}of Fo(E,"forward")){if(z.has(Q))continue;const se=Q.getAttribute("listIndent");ne&&seu.includes(st)));const Pe=Ln(Q,{direction:"forward"});for(const st of Pe)z.add(st),(k(st,Pe)||A(st,H,S))&&O.push(st)}return O}function k(E,S){const O=d.mapper.toViewElement(E);if(!O)return!1;if(h.fire("checkElement",{modelElement:E,viewElement:O}))return!0;if(!E.is("element","paragraph")&&!E.is("element","listItem"))return!1;const z=Ek(E,u,S);return!(!z||!O.is("element","p"))||!(z||!O.is("element","span"))}function A(E,S,O){if(O.has(E))return!1;const z=d.mapper.toViewElement(E);let H=S.length-1;for(let Q=z.parent;!Q.is("editableElement");Q=Q.parent){const ne=ks(Q),se=_k(Q);if(!se&&!ne)continue;const Pe="checkAttributes:"+(ne?"item":"list");if(h.fire(Pe,{viewElement:Q,modelAttributes:S[H]}))break;if(se&&(H--,H<0))return!1}return!0}}(t,e.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:d,modelAttributes:u})=>{d.id!=u.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:d,modelAttributes:u})=>{d.name==Ak(u.listType)&&d.id==Ck(u.listType,u.listIndent)||(l.return=!0,l.stop())})}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(n=>function(o,r,s,a){const c=o.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let u=!1;for(const m of c){if(m.type=="insert"&&m.name!="$text"){const k=m.position.nodeAfter;if(!o.schema.checkAttribute(k,"listItemId"))for(const A of Array.from(k.getAttributeKeys()))s.includes(A)&&(r.removeAttribute(A,k),u=!0);Xt(m.position,l),m.attributes.has("listItemId")||Xt(m.position.getShiftedBy(m.length),l);for(const{item:A,previousPosition:E}of o.createRangeIn(k))rt(A)&&Xt(E,l)}else m.type=="remove"?Xt(m.position,l):m.type=="attribute"&&s.includes(m.attributeKey)&&(Xt(m.range.start,l),m.attributeNewValue===null&&Xt(m.range.start.getShiftedBy(1),l));if(!d&&m.type=="attribute"&&bs.includes(m.attributeKey)){const k=m.range.start.nodeAfter;m.attributeNewValue===null&&k&&k.is("element","listItem")?(r.rename(k,"paragraph"),u=!0):m.attributeOldValue===null&&k&&k.is("element")&&k.name!="listItem"&&(r.rename(k,"listItem"),u=!0)}}const h=new Set;for(const m of l.values())u=a.fire("postFixer",{listNodes:new EE(m),listHead:m,writer:r,seenIds:h})||u;return u}(e,n,t,this)),this.on("postFixer",(n,{listNodes:o,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,u=!1;for(const{node:h}of s){const m=h.getAttribute("listIndent");if(m>c){let k;d===null?(d=m-c,k=c):(d>m&&(d=m),k=m-d),k>l+1&&(k=l+1),a.setAttribute("listIndent",k,h),u=!0,l=k}else d=null,c=m+1,l=m}return u}(o,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:o,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let u=!1;for(const{node:h}of a){if(d.has(h))continue;let m=h.getAttribute("listType"),k=h.getAttribute("listItemId");if(c.has(k)&&(k=Ui.next()),c.add(k),h.is("element","listItem"))h.getAttribute("listItemId")!=k&&(l.setAttribute("listItemId",k,h),u=!0);else for(const A of Ln(h,{direction:"forward"}))d.add(A),A.getAttribute("listType")!=m&&(k=Ui.next(),m=A.getAttribute("listType")),A.getAttribute("listItemId")!=k&&(l.setAttribute("listItemId",k,A),u=!0)}return u}(o,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(n){return(o,[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(rt(c.parent))l=c.parent;else{if(!rt(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const u=l.getAttribute("listType"),h=l.getAttribute("listIndent"),m=a[0].getAttribute("listIndent")||0,k=Math.max(h-m,0);for(const A of a){const E=rt(A);l.is("element","listItem")&&A.is("element","paragraph")&&d.rename(A,"listItem"),d.setAttributes({listIndent:(E?A.getAttribute("listIndent"):0)+k,listItemId:E?A.getAttribute("listItemId"):Ui.next(),listType:u},A)}})}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(n,o)=>{e.change(r=>{const s=Array.from(o.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every(rt)&&r.remove(a),o.method=="copy"||o.method=="cut"){const c=Array.from(o.content.getChildren());Uo(c)&&ps(c,r)}})})}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function Ik(i,e){const t=i.document.selection;if(!t.isCollapsed)return!Wo(i);if(e==="forward")return!0;const n=t.getFirstPosition().parent,o=n.previousSibling;return!i.schema.isObject(o)&&(!!o.isEmpty||Uo([n,o]))}function Sk(i,e,t,n){i.ui.componentFactory.add(e,()=>{const o=Bk(Ae,i,e,t,n);return o.set({tooltip:!0,isToggleable:!0}),o}),i.ui.componentFactory.add(`menuBar:${e}`,()=>Bk(It,i,e,t,n))}function Bk(i,e,t,n,o){const r=e.commands.get(t),s=new i(e.locale);return s.set({label:n,icon:o}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{e.execute(t),e.editing.view.focus()}),s}class KE extends G{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||Sk(this.editor,"numberedList",e("Numbered List"),oe.numberedList),this.editor.ui.componentFactory.has("bulletedList")||Sk(this.editor,"bulletedList",e("Bulleted List"),oe.bulletedList)}}class YE extends G{static get requires(){return[$E,KE]}static get pluginName(){return"List"}}const QE=[{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:i,typeAttribute:e,listType:t}of QE);var Nk=I(9968),ZE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Nk.A,ZE),Nk.A.locals;var Ok=I(7141),JE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Ok.A,JE),Ok.A.locals,go("Ctrl+Enter");var Pk=I(8991),XE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Pk.A,XE),Pk.A.locals,go("Ctrl+Enter");function Lk(i,e){const t=(n,o,r)=>{if(!r.consumable.consume(o.item,n.name))return;const s=o.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(o.item),l=[...c.getChildren()].find(u=>u.getCustomProperty("media-content"));a.remove(l);const d=i.getMediaViewElement(a,s,e);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",t)}}function zk(i,e,t,n){return i.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(i,t,n),i.createSlot()])}function Rk(i){const e=i.getSelectedElement();return e&&e.is("element","media")?e:null}function jk(i,e,t,n){i.change(o=>{const r=o.createElement("media",{url:e});i.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class e5 extends de{refresh(){const e=this.editor.model,t=e.document.selection,n=Rk(t);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(o){const r=o.getSelectedElement();return!!r&&r.name==="media"}(t)||function(o,r){let a=Fm(o,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(t,e)}execute(e){const t=this.editor.model,n=t.document.selection,o=Rk(n);o?t.change(r=>{r.setAttribute("url",e,o)}):jk(t,e,n,!0)}}class t5{constructor(e,t){const n=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),s=n.concat(o).filter(a=>{const c=a.name;return c?!r.has(c):(X("media-embed-no-provider-name",{provider:a}),!1)});this.locale=e,this.providerDefinitions=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e)return new Fk(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,o=Oe(t.url);for(const r of o){const s=this._getUrlMatches(e,r);if(s)return new Fk(this.locale,e,s,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let o=e.replace(/^https?:\/\//,"");return n=o.match(t),n||(o=o.replace(/^www\./,""),n=o.match(t),n||null)}}class Fk{constructor(e,t,n,o){this.url=this._getValidUrl(t),this._locale=e,this._match=n,this._previewRenderer=o}getViewElement(e,t){const n={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),o=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new kn,t=this._locale.t;return e.content='',e.viewBox="0 0 64 42",new Gt({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}var Vk=I(7048),n5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Vk.A,n5),Vk.A.locals;class ws extends G{constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`
`},{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:t=>{const n=t[1],o=t[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:t=>`
`},{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 t5(e.locale,e.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),s=e.config.get("mediaEmbed.elementName"),a=this.registry;e.commands.add("mediaEmbed",new e5(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return zk(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),o.for("dataDowncast").add(Lk(a,{elementName:s,renderMediaPreview:r})),o.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(u,h,m){return h.setCustomProperty("media",!0,u),nc(u,h,{label:m})}(zk(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),o.for("editingDowncast").add(Lk(a,{elementName:s,renderForEditingView:!0})),o.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,u)=>{if(!u.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:h,modelCursor:m}=u.convertChildren(d.viewItem,d.modelCursor);d.modelRange=h,d.modelCursor=m,at(h.getItems())||u.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const i5=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class o5 extends G{constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[rp,_n,dp]}static get pluginName(){return"AutoMediaEmbed"}init(){const e=this.editor,t=e.model.document,n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const o=t.selection.getFirstRange(),r=ht.fromPosition(o.start);r.stickiness="toPrevious";const s=ht.fromPosition(o.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(w.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,o=n.plugins.get(ws).registry,r=new Tt(e,t),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(i5)||!o.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=ht.fromPosition(e),this._timeoutId=w.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),jk(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(_n).requestUndoOnBackspace()},100)):r.detach()}}var Hk=I(5651),r5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Hk.A,r5),Hk.A.locals;class s5 extends te{constructor(e,t){super(t);const n=t.t;this.focusTracker=new ct,this.keystrokes=new ft,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),oe.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),oe.cancel,"ck-button-cancel","cancel"),this._focusables=new zt,this._focusCycler=new jt({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,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(),br({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Fr(this.locale,Ur),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),t}_createButton(e,t,n,o){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}}class a5 extends G{static get requires(){return[ws]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed");e.ui.componentFactory.add("mediaEmbed",n=>{const o=bn(n);return this._setUpDropdown(o,t),o})}_setUpDropdown(e,t){const n=this.editor,o=n.t,r=e.buttonView,s=n.plugins.get(ws).registry;e.once("change:isOpen",()=>{const a=new(ea(s5))(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);e.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=t.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),e.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),e.on("change:isOpen",()=>a.resetFormStatus()),e.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(e),a.urlInputView.fieldView.bind("value").to(t,"value"),a.urlInputView.on("change:errorText",()=>{n.ui.update()}),a.urlInputView.bind("isEnabled").to(t,"isEnabled")}),e.bind("isEnabled").to(t),r.set({label:o("Insert media"),icon:'',tooltip:!0})}}var Uk=I(70),c5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};K()(Uk.A,c5),Uk.A.locals;function Wk(i){return i!==void 0&&i.endsWith("px")}function Wi(i){return i.toFixed(2).replace(/\.?0+$/,"")+"px"}var l5=Object.defineProperty,d5=Object.defineProperties,u5=Object.getOwnPropertyDescriptors,qk=Object.getOwnPropertySymbols,h5=Object.prototype.hasOwnProperty,g5=Object.prototype.propertyIsEnumerable,Gk=(i,e,t)=>e in i?l5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,m5=(i,e)=>{for(var t in e||(e={}))h5.call(e,t)&&Gk(i,t,e[t]);if(qk)for(var t of qk(e))g5.call(e,t)&&Gk(i,t,e[t]);return i};function p5(i,e,t){if(!i.childCount)return;const n=new fn(i.document),o=function(c,l){const d=l.createRangeIn(c),u=[],h=new Set;for(const m of d.getItems()){if(!m.is("element")||!m.name.match(/^(p|h\d+|li|div)$/))continue;let k=v5(m);if(k===void 0||parseFloat(k)!=0||Array.from(m.getClassNames()).find(A=>A.startsWith("MsoList"))||(k=void 0),m.hasStyle("mso-list")||k!==void 0&&h.has(k)){const A=A5(m);u.push({element:m,id:A.id,order:A.order,indent:A.indent,marginLeft:k}),k!==void 0&&h.add(k)}else h.clear()}return u}(i,n);if(!o.length)return;const r={},s=[];for(const c of o)if(c.indent!==void 0){f5(c)||(s.length=0);const l=`${c.id}:${c.indent}`,d=Math.min(c.indent-1,s.length);if(ds.length-1||s[d].listElement.name!=h.type){d==0&&h.type=="ol"&&c.id!==void 0&&r[l]&&(h.startIndex=r[l]);const m=_5(h,n,t);if(Wk(c.marginLeft)&&(d==0||Wk(s[d-1].marginLeft))){let k=c.marginLeft;d>0&&(k=Wi(parseFloat(k)-parseFloat(s[d-1].marginLeft))),n.setStyle("padding-left",k,m)}if(s.length==0){const k=c.element.parent,A=k.getChildIndex(c.element)+1;n.insertChild(A,m,k)}else{const k=s[d-1].listItemElements;n.appendChild(m,k[k.length-1])}s[d]=(a=m5({},c),d5(a,u5({listElement:m,listItemElements:[]}))),d==0&&c.id!==void 0&&(r[l]=h.startIndex||1)}}const u=c.element.name=="li"?c.element:n.createElement("li");n.appendChild(u,s[d].listElement),s[d].listItemElements.push(u),d==0&&c.id!==void 0&&r[l]++,c.element!=u&&n.appendChild(c.element,u),C5(c.element,n),n.removeStyle("text-indent",c.element),n.removeStyle("margin-left",c.element)}else{const l=s.find(d=>d.marginLeft==c.marginLeft);if(l){const d=l.listItemElements;n.appendChild(c.element,d[d.length-1]),n.removeStyle("margin-left",c.element)}else s.length=0}var a}function f5(i){const e=i.element.previousSibling;return k5(e||i.element.parent)}function k5(i){return i.is("element","ol")||i.is("element","ul")}function b5(i,e){const t=new RegExp(`@list l${i.id}:level${i.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,o=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${i.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),s=new RegExp(`@list l${i.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=r.exec(e),c=s.exec(e),l=a&&!c,d=t.exec(e);let u="decimal",h="ol",m=null;if(d&&d[1]){const k=n.exec(d[1]);if(k&&k[1]&&(u=k[1].trim(),h=u!=="bullet"&&u!=="image"?"ol":"ul"),u==="bullet"){const A=function(E){if(E.name=="li"&&E.parent.name=="ul"&&E.parent.hasAttribute("type"))return E.parent.getAttribute("type");const S=function(z){if(z.getChild(0).is("$text"))return null;for(const H of z.getChildren()){if(!H.is("element","span"))continue;const Q=H.getChild(0);if(Q)return Q.is("$text")?Q:Q.getChild(0)}return null}(E);if(!S)return null;const O=S._data;return O==="o"?"circle":O==="·"?"disc":O==="§"?"square":null}(i.element);A&&(u=A)}else{const A=o.exec(d[1]);A&&A[1]&&(m=parseInt(A[1]))}l&&(h="ol")}return{type:h,startIndex:m,style:w5(u),isLegalStyleList:l}}function w5(i){if(i.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(i){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return i;default:return null}}function _5(i,e,t){const n=e.createElement(i.type);return i.style&&e.setStyle("list-style-type",i.style,n),i.startIndex&&i.startIndex>1&&e.setAttribute("start",i.startIndex,n),i.isLegalStyleList&&t&&e.addClass("legal-list",n),n}function A5(i){const e=i.getStyle("mso-list");if(e===void 0)return{};const t=e.match(/(^|\s{1,100})l(\d+)/i),n=e.match(/\s{0,100}lfo(\d+)/i),o=e.match(/\s{0,100}level(\d+)/i);return t&&n&&o?{id:t[2],order:n[1],indent:parseInt(o[1])}:{indent:1}}function C5(i,e){const t=new cn({name:"span",styles:{"mso-list":"Ignore"}}),n=e.createRangeIn(i);for(const o of n)o.type==="elementStart"&&t.match(o.item)&&e.remove(o.item)}function v5(i){const e=i.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:function(t){const n=parseFloat(t);return t.endsWith("pt")?Wi(96*n/72):t.endsWith("pc")?Wi(12*n*96/72):t.endsWith("in")?Wi(96*n):t.endsWith("cm")?Wi(96*n/2.54):t.endsWith("mm")?Wi(n/10*96/2.54):t}(e)}function y5(i,e){if(!i.childCount)return;const t=new fn(i.document),n=function(r,s){const a=s.createRangeIn(r),c=new cn({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const u=d.item,h=u.previousSibling,m=h&&h.is("element")?h.name:null,k=["Chart"],A=c.match(u),E=u.getAttribute("o:gfxdata"),S=m==="v:shapetype",O=E&&k.some(z=>u.getAttribute("id").includes(z));A&&E&&!S&&!O&&l.push(d.item.getAttribute("id"))}return l}(i,t);(function(r,s,a){const c=a.createRangeIn(s),l=new cn({name:"img"}),d=[];for(const u of c)if(u.item.is("element")&&l.match(u.item)){const h=u.item,m=h.getAttribute("v:shapes")?h.getAttribute("v:shapes").split(" "):[];m.length&&m.every(k=>r.indexOf(k)>-1)?d.push(h):h.getAttribute("src")||d.push(h)}for(const u of d)a.remove(u)})(n,i,t),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const h of c)if(h.type=="elementStart"&&h.item.is("element","v:shape")){const m=h.item.getAttribute("id");if(r.includes(m))continue;d(h.item.parent.getChildren(),m)||l.push(h.item)}for(const h of l){const m={src:u(h)};h.hasAttribute("alt")&&(m.alt=h.getAttribute("alt"));const k=a.createElement("img",m);a.insertChild(h.index+1,k,h.parent)}function d(h,m){for(const k of h)if(k.is("element")&&(k.name=="img"&&k.getAttribute("v:shapes")==m||d(k.getChildren(),m)))return!0;return!1}function u(h){for(const m of h.getChildren())if(m.is("element")&&m.getAttribute("src"))return m.getAttribute("src")}}(n,i,t),function(r,s){const a=s.createRangeIn(r),c=new cn({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)}(i,t);const o=function(r,s){const a=s.createRangeIn(r),c=new cn({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}(i,t);o.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(e,16))).join(""))}const D5=//i,E5=/xmlns:o="urn:schemas-microsoft-com/i;class T5{constructor(e,t=!1){this.document=e,this.hasMultiLevelListPlugin=t}isActive(e){return D5.test(e)||E5.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;p5(t,n,this.hasMultiLevelListPlugin),y5(t,e.dataTransfer.getData("text/rtf")),function(o){const r=[],s=new fn(o.document);for(const{item:a}of s.createRangeIn(o))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")||a.is("element","w:sdtpr")&&a.isEmpty||a.is("element","o:p")&&a.isEmpty)&&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)}}(t),e.content=t}}function $k(i,e,t,{blockElements:n,inlineObjectElements:o}){let r=t.createPositionAt(i,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!o.includes(s.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function Kk(i,e){return!!i&&i.is("element")&&e.includes(i.name)}const M5=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class I5{constructor(e){this.document=e}isActive(e){return M5.test(e)}execute(e){const t=new fn(this.document),{body:n}=e._parsedData;(function(o,r){for(const s of o.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=o.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),o)}})(n,t),function(o,r){for(const s of r.createRangeIn(o)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,t),function(o,r){const s=new xr(r.document.stylesProcessor),a=new Tr(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const u of r.createRangeIn(o)){const h=u.item;if(h.is("element","br")){const m=$k(h,"forward",r,{blockElements:c,inlineObjectElements:l}),k=$k(h,"backward",r,{blockElements:c,inlineObjectElements:l}),A=Kk(m,c);(Kk(k,c)||A)&&d.push(h)}}for(const u of d)u.hasClass("Apple-interchange-newline")?r.remove(u):r.replace(u,r.createElement("p"))}(n,t),e.content=n}}const S5=/(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join("  ").substr(0,t.length))}function N5(i,e){const t=new DOMParser,n=function(c){return Yk(Yk(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="",u=c.indexOf(l);if(u<0)return c;const h=c.indexOf(d,u+l.length);return c.substring(0,u+l.length)+(h>=0?c.substring(h):"")}(i=(i=i.replace(/