@esri/calcite-components 5.2.0-next.14 → 5.2.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{WFM52MRQ.js → 23CKFJJ3.js} +1 -1
- package/dist/cdn/{7PO443AZ.js → 25ZVWCQX.js} +1 -1
- package/dist/cdn/{QR2CY34G.js → 2BPEKIT3.js} +1 -1
- package/dist/cdn/{D4VDP2CJ.js → 2YBRZFRA.js} +1 -1
- package/dist/cdn/{OV7EBZPB.js → 34JHLJ3H.js} +1 -1
- package/dist/cdn/{LK3625ZO.js → 3I5BTEEC.js} +1 -1
- package/dist/cdn/{LJPWEOCO.js → 3N5FOQAL.js} +1 -1
- package/dist/cdn/{QCZA4MJZ.js → 3U4ZWJVW.js} +1 -1
- package/dist/cdn/{I2H4WGUS.js → 44MSN4BY.js} +1 -1
- package/dist/cdn/{PTH7GUAT.js → 44P2MJGD.js} +1 -1
- package/dist/cdn/{HLQVOOYB.js → 4EHBKF47.js} +1 -1
- package/dist/cdn/{XHRQMRVG.js → 4GEVIBLZ.js} +1 -1
- package/dist/cdn/{SDDCAWLS.js → 4IFN3JAF.js} +1 -1
- package/dist/cdn/{Q7WHVLIS.js → 4IMOW4XR.js} +1 -1
- package/dist/cdn/{6Q4TUT5Y.js → 4NVF6ZE7.js} +1 -1
- package/dist/cdn/{JBDHPNDM.js → 4TIEXZFH.js} +1 -1
- package/dist/cdn/{6HSIDCQD.js → 5R66KNRS.js} +1 -1
- package/dist/cdn/{KSKQOJZX.js → 5RU4WRDH.js} +1 -1
- package/dist/cdn/{RLE74BGN.js → 5UODEL4J.js} +1 -1
- package/dist/cdn/{ZNGJAGTZ.js → 62H6YWOD.js} +1 -1
- package/dist/cdn/{TMRLVWBO.js → 667BX6C2.js} +1 -1
- package/dist/cdn/{CR7M7KVL.js → 67UZPLTH.js} +1 -1
- package/dist/cdn/{HG5J2NEG.js → 6AK6KZDQ.js} +1 -1
- package/dist/cdn/{PGUXZOTZ.js → 6MFBNGHM.js} +1 -1
- package/dist/cdn/{A6VJGLSS.js → 6OZPUPKW.js} +1 -1
- package/dist/cdn/{P6DSHT3Y.js → 6P5O53FC.js} +1 -1
- package/dist/cdn/{D6XD3BXF.js → 6UUG7BR5.js} +1 -1
- package/dist/cdn/{ABMJH33P.js → 743PCCPR.js} +1 -1
- package/dist/cdn/{44HY2CJ4.js → 7KHQNJUK.js} +1 -1
- package/dist/cdn/{7WTBOSC5.js → 7NECG5PK.js} +1 -1
- package/dist/cdn/{UFW5G6ZY.js → 7TXXRTD6.js} +1 -1
- package/dist/cdn/{WCEPBGPF.js → ADXJH4JG.js} +1 -1
- package/dist/cdn/{IUW6CWCX.js → AOXRDXK3.js} +1 -1
- package/dist/cdn/{U4TZRIC5.js → B2ORCPWA.js} +1 -1
- package/dist/cdn/{FEJS343B.js → B2Z2OFXW.js} +1 -1
- package/dist/cdn/{PWGR5AJD.js → B3QZ2XNQ.js} +1 -1
- package/dist/cdn/{B3FIO2DT.js → B3UUKGE4.js} +1 -1
- package/dist/cdn/{3AKE4BCT.js → B5Q7JLP5.js} +1 -1
- package/dist/cdn/{W7AGRLRI.js → B6AJO7QQ.js} +1 -1
- package/dist/cdn/{LS43N4RX.js → BCQDFCKN.js} +1 -1
- package/dist/cdn/{ZGO66DGC.js → BKBRE6BE.js} +1 -1
- package/dist/cdn/{H4VRREJL.js → BLVQHZ6I.js} +1 -1
- package/dist/cdn/{MXTIZU2R.js → BQLQFRQU.js} +1 -1
- package/dist/cdn/{6CTVP6XP.js → BWYJRS53.js} +1 -1
- package/dist/cdn/{GJNU6EMY.js → CMSVRAIL.js} +1 -1
- package/dist/cdn/{C7EIL5WB.js → CULRGSU4.js} +1 -1
- package/dist/cdn/{JVKBC3XX.js → D2HKARC2.js} +1 -1
- package/dist/cdn/{ORAHJ4QI.js → D52NOMC4.js} +1 -1
- package/dist/cdn/{I3NOTK5S.js → D7VHKSBM.js} +1 -1
- package/dist/cdn/{NGE5JQLU.js → DEJB6LKH.js} +1 -1
- package/dist/cdn/{6D5AK4GJ.js → E622Q2TQ.js} +1 -1
- package/dist/cdn/{GWXFMOCL.js → E7IC4K6C.js} +1 -1
- package/dist/cdn/{4MGG67YX.js → EZQKTHH3.js} +1 -1
- package/dist/cdn/{QSPWWIIZ.js → F5OYYX7P.js} +1 -1
- package/dist/cdn/{Y3FAB6G2.js → FNJIBEB2.js} +1 -1
- package/dist/cdn/{6Q33X7P4.js → FP434YLN.js} +1 -1
- package/dist/cdn/{545MJ5AY.js → FQ6VKBCC.js} +1 -1
- package/dist/cdn/{4EC2NTV4.js → G6FR4KMK.js} +1 -1
- package/dist/cdn/{QZSPTHHD.js → GW747T3W.js} +1 -1
- package/dist/cdn/{3UXDKWOB.js → GWUTSOHK.js} +1 -1
- package/dist/cdn/{HLJQDLHI.js → H37WKFXM.js} +1 -1
- package/dist/cdn/{WVZMOFAQ.js → H4L4EHB2.js} +1 -1
- package/dist/cdn/{EQWEKQDO.js → H5TXFZSO.js} +1 -1
- package/dist/cdn/{BVYG6VVD.js → H7AVJRRT.js} +1 -1
- package/dist/cdn/{OECHJXEQ.js → HA3LHNRC.js} +1 -1
- package/dist/cdn/{ZQW5EHUD.js → HHWIABV7.js} +1 -1
- package/dist/cdn/{66FRAAIX.js → HLSREAGB.js} +1 -1
- package/dist/cdn/{FZ53VYVY.js → HXJ3PWDD.js} +1 -1
- package/dist/cdn/{GS5ZCHGY.js → IEV3ZJGY.js} +1 -1
- package/dist/cdn/{G5FIT3VP.js → IK2ZWLKD.js} +1 -1
- package/dist/cdn/{VH5BZDLX.js → IMNESPYO.js} +1 -1
- package/dist/cdn/{AVV4E53Z.js → IWV3N5DN.js} +1 -1
- package/dist/cdn/{UBTLX7CK.js → JSWUC46W.js} +1 -1
- package/dist/cdn/{2RQWAUJS.js → JTOHCGX2.js} +1 -1
- package/dist/cdn/{EEUC3KBF.js → KG6IVYF4.js} +1 -1
- package/dist/cdn/{UZZGN37F.js → KNTHSCWX.js} +1 -1
- package/dist/cdn/{XZEWXNBK.js → KSGT4GRV.js} +1 -1
- package/dist/cdn/{SXMZWDUQ.js → KVCFGTZC.js} +1 -1
- package/dist/cdn/{MSAH5RX3.js → LDIOQBSI.js} +1 -1
- package/dist/cdn/{EH3ZS3AI.js → LF6MQ6HF.js} +1 -1
- package/dist/cdn/{UVGPW4FV.js → LHPCIKUI.js} +1 -1
- package/dist/cdn/{SYSWISF6.js → LMNS42HV.js} +1 -1
- package/dist/cdn/{V3VTO2ZZ.js → MDEHQJED.js} +1 -1
- package/dist/cdn/{DWAZPL2W.js → MDWQVFCB.js} +1 -1
- package/dist/cdn/{SCWTJCNK.js → MGSMKR2I.js} +1 -1
- package/dist/cdn/{LNQK4SQB.js → MPBEGHZK.js} +1 -1
- package/dist/cdn/{BL5X256T.js → MZ7UQKEU.js} +1 -1
- package/dist/cdn/{4GDHH5DV.js → NMTRXY5U.js} +1 -1
- package/dist/cdn/NR7I7ABN.js +2 -0
- package/dist/cdn/{KD7UHFNY.js → NRGZYLHS.js} +1 -1
- package/dist/cdn/{3NCFJD25.js → NVMXMJKA.js} +1 -1
- package/dist/cdn/{Z7GJKEIA.js → NY44QG3Z.js} +1 -1
- package/dist/cdn/{3PLEDPR4.js → OD4W6GP7.js} +1 -1
- package/dist/cdn/{A56N4SUK.js → OZWW4O5S.js} +1 -1
- package/dist/cdn/{G37Q6LNH.js → PBNAZWZY.js} +1 -1
- package/dist/cdn/{YJLCYJ2M.js → PDEJLZ3D.js} +1 -1
- package/dist/cdn/{EO5N74I3.js → PQYNJXHD.js} +1 -1
- package/dist/cdn/{KCTZSNBT.js → Q4ZZN7TG.js} +1 -1
- package/dist/cdn/{4HIEDMZD.js → Q54HXE6A.js} +1 -1
- package/dist/cdn/{G7GLZIL5.js → Q7GAT2DB.js} +1 -1
- package/dist/cdn/{HJSWKTWW.js → QDCCLW4T.js} +1 -1
- package/dist/cdn/{UT3IREUB.js → QLNZXK7M.js} +1 -1
- package/dist/cdn/{BSF3NY4V.js → QQEZNIQC.js} +1 -1
- package/dist/cdn/{OUSNZRJZ.js → QZUGIHZN.js} +1 -1
- package/dist/cdn/{FEJWDUDH.js → RF7K7DTZ.js} +1 -1
- package/dist/cdn/{SOHXC2HB.js → RJUGARBU.js} +1 -1
- package/dist/cdn/{B66XEYW2.js → RZULQ2JP.js} +1 -1
- package/dist/cdn/{QWBN3AWD.js → SBGFZIL5.js} +1 -1
- package/dist/cdn/{YS6CLONR.js → SDUVQU3B.js} +1 -1
- package/dist/cdn/{6JHWUVP4.js → SHDZO7WL.js} +1 -1
- package/dist/cdn/{MMNBD7LM.js → SI2JU5OQ.js} +1 -1
- package/dist/cdn/{ZF6T2CLM.js → TQ3C46K7.js} +1 -1
- package/dist/cdn/{UVD3MS5W.js → TQOSF3DK.js} +1 -1
- package/dist/cdn/{OODIPTDH.js → TR56RG7Q.js} +1 -1
- package/dist/cdn/{X6Q5JZBS.js → TTNGUCIA.js} +1 -1
- package/dist/cdn/{A5XTOCVX.js → TVX7XVJC.js} +1 -1
- package/dist/cdn/{VP3UYOHO.js → UFJCW5EG.js} +1 -1
- package/dist/cdn/{3CJCDXXM.js → UHDMAQIY.js} +1 -1
- package/dist/cdn/{H7EDS3CQ.js → UI2Y2KED.js} +1 -1
- package/dist/cdn/{7WMROAW4.js → UJXHOMUC.js} +1 -1
- package/dist/cdn/{7D4K4QDI.js → UTSULH62.js} +1 -1
- package/dist/cdn/{TEIBL22G.js → VRNR72VI.js} +1 -1
- package/dist/cdn/{PN5LDURO.js → W5QIPFSJ.js} +1 -1
- package/dist/cdn/{TS6R5IK4.js → WHGBMNS4.js} +1 -1
- package/dist/cdn/{GCB2FLDV.js → WL2UZNLW.js} +1 -1
- package/dist/cdn/{OAOMEBGK.js → X3TBQXF6.js} +1 -1
- package/dist/cdn/{LURVUV4O.js → XJMNQRUJ.js} +1 -1
- package/dist/cdn/{MVJAI5VF.js → XLHTNALK.js} +1 -1
- package/dist/cdn/{ZU6KB5AC.js → XVNOPWL3.js} +1 -1
- package/dist/cdn/{EXV5UE47.js → Y5JJBAGO.js} +1 -1
- package/dist/cdn/{JVDVZORD.js → Y6JHEDKL.js} +1 -1
- package/dist/cdn/{6YLJ3NL4.js → YFT3HJ6C.js} +1 -1
- package/dist/cdn/{RPIHDJF2.js → YGO2VHM5.js} +1 -1
- package/dist/cdn/YPCHV7D7.js +2 -0
- package/dist/cdn/{LAH33JTG.js → Z3VY5WT2.js} +1 -1
- package/dist/cdn/{R5LGIEUS.js → Z5X6I2G7.js} +1 -1
- package/dist/cdn/{K76VTOP3.js → ZD7I7RV6.js} +1 -1
- package/dist/cdn/{GDP3QRZQ.js → ZFHW7RUW.js} +1 -1
- package/dist/cdn/{33AXJNE7.js → ZHNSJJ4O.js} +1 -1
- package/dist/cdn/ZOAYIZNY.js +2 -0
- package/dist/cdn/{4VDL3UOJ.js → ZS6DTRJ2.js} +1 -1
- package/dist/cdn/{4363MSYP.js → ZSX6UO57.js} +1 -1
- package/dist/cdn/ZT2T23RU.js +2 -0
- package/dist/cdn/{B64URJTB.js → ZUIIHKJP.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-combobox/customElement.js +1 -1
- package/dist/components/calcite-table/customElement.d.ts +6 -0
- package/dist/components/calcite-table/customElement.js +80 -5
- package/dist/components/calcite-table-cell/customElement.js +3 -2
- package/dist/components/calcite-table-header/customElement.js +1 -1
- package/dist/components/calcite-table-row/customElement.js +26 -15
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cdn/KBUGK427.js +0 -2
- package/dist/cdn/PZX674UB.js +0 -2
- package/dist/cdn/TEGKCRK6.js +0 -2
- package/dist/cdn/TNG5UZWM.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{c as m,d as k,e as v}from"./
|
|
2
|
+
import{c as m,d as k,e as v}from"./HLSREAGB.js";import{a as E}from"./DEJB6LKH.js";import{a as f}from"./KVCFGTZC.js";import{a as g}from"./ADXJH4JG.js";import"./ZWPNZ5XW.js";import"./BKBRE6BE.js";import"./NRGZYLHS.js";import{u as p}from"./RJUGARBU.js";import"./T6CCMW7H.js";import{E as c,F as o,G as h,H as i,J as s,S as b,g as u,h as a,p as l}from"./OD4W6GP7.js";var C=u`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) .controls-wrapper{block-size:1.5rem}:host([scale=m]) .controls-wrapper{block-size:2rem}:host([scale=l]) .controls-wrapper{block-size:2.75rem}.wrapper{box-sizing:border-box;display:flex;justify-content:space-between;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;background-color:var(--calcite-inline-editable-background-color, var(--calcite-color-foreground-1))}.wrapper .input-wrapper{flex:1 1 0%}:host(:not([editing-enabled]):not([disabled])) .wrapper:hover{background-color:var(--calcite-inline-editable-background-color-hover, var(--calcite-color-foreground-2))}.controls-wrapper{display:flex}.cancel-editing-button[appearance=transparent][kind=neutral]{--calcite-internal-button-text-color: var(--calcite-color-text-3);--calcite-internal-button-border-block-start-color: var(--calcite-color-border-input);--calcite-internal-button-border-block-end-color: var(--calcite-color-border-input)}.cancel-editing-button[appearance=transparent][kind=neutral]:hover{--calcite-internal-button-text-color: var(--calcite-color-text-1)}.enable-editing-button--hidden{pointer-events:none;opacity:0;inline-size:0}.enable-editing-button[appearance=transparent][kind=neutral]{--calcite-internal-button-background-color: transparent}calcite-button{--calcite-button-background-color: var(--calcite-inline-editable-button-background-color);--calcite-button-corner-radius: var(--calcite-inline-editable-button-corner-radius);--calcite-button-loader-color: var(--calcite-inline-editable-button-loader-color);--calcite-button-text-color: var(--calcite-inline-editable-button-text-color)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,n={wrapper:"wrapper",confirmChangesButton:"confirm-changes-button",cancelEditingButton:"cancel-editing-button",inputWrapper:"input-wrapper",cancelEditingButtonWrapper:"cancel-editing-button-wrapper",enableEditingButton:"enable-editing-button",enableEditingButtonHidden:"enable-editing-button--hidden",controlsWrapper:"controls-wrapper"},r={check:"check",close:"x",pencil:"pencil"},d=class extends h{constructor(){super(),this.cancelEditingButtonRef=c(),this._editingEnabled=!1,this.enableEditingButtonRef=c(),this.shouldEmitCancel=!1,this.valuePriorToEditing="",this.messages=f(),this.focusSetter=g()(this),this.interactiveContainer=E(this),this.controls=!1,this.disabled=!1,this.loading=!1,this.scale="m",this.calciteInlineEditableEditCancel=l({cancelable:!1}),this.calciteInlineEditableEditConfirm=l({cancelable:!1}),this.calciteInternalInlineEditableEnableEditingChange=l({cancelable:!1}),this.listen("calciteInternalInputBlur",this.blurHandler)}static{this.properties={afterConfirm:[0,{},{attribute:!1}],controls:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],editingEnabled:[7,{},{reflect:!0,type:Boolean}],loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=C}get shouldShowControls(){return this.editingEnabled&&this.controls}get editingEnabled(){return this._editingEnabled}set editingEnabled(t){let e=this._editingEnabled;t!==e&&(this._editingEnabled=t,this.editingEnabledWatcher(t,e))}async setFocus(t){return this.focusSetter(()=>this.inputEl,t)}connectedCallback(){super.connectedCallback(),m(this)}disconnectedCallback(){super.disconnectedCallback(),k(this)}editingEnabledWatcher(t,e){this.inputEl&&(this.inputEl.editingEnabled=t),!t&&e&&(this.shouldEmitCancel=!0)}blurHandler(){this.controls||this.disableEditing()}async handleDefaultSlotChange(t){let e=p(t).filter(y=>y.matches("calcite-input"))[0];this.inputEl=e,e&&(await e.componentOnReady(),e.editingEnabled=this.editingEnabled,e.label=e.label||v(this))}onLabelClick(){this.setFocus()}enableEditing(){this.valuePriorToEditing=this.inputEl?.value??"",this.editingEnabled=!0,this.inputEl?.setFocus(),this.calciteInternalInlineEditableEnableEditingChange.emit()}disableEditing(){this.editingEnabled=!1}cancelEditing(){this.inputEl&&(this.inputEl.value=this.valuePriorToEditing),this.disableEditing(),this.enableEditingButtonRef.value?.setFocus(),!this.editingEnabled&&this.shouldEmitCancel&&this.calciteInlineEditableEditCancel.emit()}escapeKeyHandler(t){t.defaultPrevented||(t.key==="Escape"&&(t.preventDefault(),this.cancelEditing()),t.key==="Tab"&&this.shouldShowControls&&(!t.shiftKey&&t.target===this.inputEl&&(t.preventDefault(),this.cancelEditingButtonRef.value?.setFocus()),t.shiftKey&&t.target===this.cancelEditingButtonRef.value&&(t.preventDefault(),this.inputEl?.setFocus())))}async cancelEditingHandler(t){t.preventDefault(),this.cancelEditing()}enableEditingHandler(t){this.disabled||t.target!==this.enableEditingButtonRef.value&&t.target!==this.inputEl||(t.preventDefault(),this.editingEnabled||this.enableEditing())}async confirmChangesHandler(t){t.preventDefault(),this.calciteInlineEditableEditConfirm.emit();try{this.afterConfirm&&(this.loading=!0,await this.afterConfirm(),this.disableEditing(),this.enableEditingButtonRef.value?.setFocus())}catch{}finally{this.loading=!1}}render(){return this.interactiveContainer({disabled:this.disabled,children:a`<div class=${i(n.wrapper)} @click=${this.enableEditingHandler} @keydown=${this.escapeKeyHandler}><div class=${i(n.inputWrapper)}><slot @slotchange=${this.handleDefaultSlotChange}></slot></div><div class=${i(n.controlsWrapper)}><calcite-button appearance=transparent class=${i({[n.enableEditingButton]:!0,[n.enableEditingButtonHidden]:this.editingEnabled})} .iconStart=${r.pencil} kind=neutral .label=${this.messages.enableEditing} @click=${this.enableEditingHandler} .scale=${this.scale} title=${this.messages.enableEditing??s} type=button ${o(this.enableEditingButtonRef)}></calcite-button>${this.shouldShowControls&&[a`<div class=${i(n.cancelEditingButtonWrapper)}><calcite-button appearance=transparent class=${i(n.cancelEditingButton)} .iconStart=${r.close} kind=neutral .label=${this.messages.cancelEditing} @click=${this.cancelEditingHandler} .scale=${this.scale} title=${this.messages.cancelEditing??s} type=button ${o(this.cancelEditingButtonRef)}></calcite-button></div>`,a`<calcite-button appearance=solid class=${i(n.confirmChangesButton)} .iconStart=${r.check} kind=brand .label=${this.messages.confirmChanges} .loading=${this.loading} @click=${this.confirmChangesHandler} .scale=${this.scale} title=${this.messages.confirmChanges??s} type=button></calcite-button>`]||""}</div></div>`})}};b("calcite-inline-editable",d);export{d as InlineEditable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as w}from"./T6CCMW7H.js";import{M as v}from"./
|
|
2
|
+
import{a as w}from"./T6CCMW7H.js";import{M as v}from"./OD4W6GP7.js";var L=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],p=L.join(","),x=typeof Element>"u",d=x?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,b=!x&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},g=function(t,r){var n;r===void 0&&(r=!0);var i=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),o=i===""||i==="true",a=o||r&&t&&(typeof t.closest=="function"?t.closest("[inert]"):g(t.parentNode));return a},q=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},A=function(t,r,n){if(g(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(p));return r&&d.call(t,p)&&i.unshift(t),i=i.filter(n),i},y=function(t,r,n){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!g(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),c=s.length?s:a.children,u=y(c,!0,n);n.flatten?i.push.apply(i,u):i.push({scopeParent:a,candidates:u})}else{var f=d.call(a,p);f&&n.filter(a)&&(r||!t.includes(a))&&i.push(a);var l=a.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(a),h=!g(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(l&&h){var T=y(l===!0?a.children:l.children,!0,n);n.flatten?i.push.apply(i,T):i.push({scopeParent:a,candidates:T})}else o.unshift.apply(o,a.children)}}return i},R=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},F=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||q(t))&&!R(t)?0:t.tabIndex},W=function(t,r){var n=F(t);return n<0&&r&&!R(t)?0:n},U=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},O=function(t){return t.tagName==="INPUT"},$=function(t){return O(t)&&t.type==="hidden"},G=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},V=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},j=function(t){if(!t.name)return!0;var r=t.form||b(t),n=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=n(window.CSS.escape(t.name));else try{i=n(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=V(i,t.form);return!o||o===t},z=function(t){return O(t)&&t.type==="radio"},X=function(t){return z(t)&&!j(t)},H=function(t){var r,n=t&&b(t),i=(r=n)===null||r===void 0?void 0:r.host,o=!1;if(n&&n!==t){var a,s,c;for(o=!!((a=i)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!o&&i;){var u,f,l;n=b(i),i=(u=n)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(l=f.ownerDocument)!==null&&l!==void 0&&l.contains(i))}}return o},C=function(t){var r=t.getBoundingClientRect(),n=r.width,i=r.height;return n===0&&i===0},Y=function(t,r){var n=r.displayCheck,i=r.getShadowRoot;if(n==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var a=getComputedStyle(t),s=a.visibility;if(s==="hidden"||s==="collapse")return!0;var c=d.call(t,"details>summary:first-of-type"),u=c?t.parentElement:t;if(d.call(u,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof i=="function"){for(var f=t;t;){var l=t.parentElement,h=b(t);if(l&&!l.shadowRoot&&i(l)===!0)return C(t);t.assignedSlot?t=t.assignedSlot:!l&&h!==t.ownerDocument?t=h.host:t=l}t=f}if(H(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return C(t);return!1},Z=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var i=r.children.item(n);if(i.tagName==="LEGEND")return d.call(r,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}r=r.parentElement}return!1},m=function(t,r){return!(r.disabled||$(r)||Y(r,t)||G(r)||Z(r))},N=function(t,r){return!(X(r)||F(r)<0||!m(t,r))},K=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},D=function(t){var r=[],n=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,c=W(s,a),u=a?D(i.candidates):s;c===0?a?r.push.apply(r,u):r.push(s):n.push({documentOrder:o,tabIndex:c,item:i,isScope:a,content:u})}),n.sort(U).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(r)},J=function(t,r){r=r||{};var n;return r.getShadowRoot?n=y([t],r.includeContainer,{filter:N.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:K}):n=A(t,r.includeContainer,N.bind(null,r)),D(n)},Q=function(t,r){r=r||{};var n;return r.getShadowRoot?n=y([t],r.includeContainer,{filter:m.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=A(t,r.includeContainer,m.bind(null,r)),n},k={getShadowRoot:!0};function gt(e){return e?e.id=e.id||`${e.tagName.toLowerCase()}-${w()}`:""}function yt(e){return Array.isArray(e)?e:Array.from(e)}function pt(e){let t=P(e,`.${v.darkMode}, .${v.lightMode}, .${v.autoMode}`);return t?.classList.contains("calcite-mode-dark")||t?.classList.contains("calcite-mode-auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mt(e){return e?parseFloat(getComputedStyle(e).inlineSize):0}function S(e){return e.getRootNode()}function St(e){let t=S(e);return"host"in t?t:null}function Tt(e,t){if(!e)return 0;let n=document.createElement("canvas").getContext("2d");return n.font=t,n.measureText(e).width}function M(e){return e.host||null}function _(e,{selector:t,id:r}){if(!e)return null;e.assignedSlot&&(e=e.assignedSlot);let n=S(e),i=r?"getElementById"in n?n.getElementById(r):null:t?n.querySelector(t):null;if(i)return i;let o=M(n);return o?_(o,{selector:t,id:r}):null}function P(e,t){if(!e)return null;let r=e.closest(t);if(r)return r;let n=M(S(e));return n?P(n,t):null}function tt(e){return typeof e?.setFocus=="function"}async function et(e,t=!1,r="tabbable",n,i){return e?tt(e)&&n!==e?e.setFocus(i):(r==="tabbable"?nt:at)(e,t,i):void 0}function rt(e,t){if(e)return J(e,{...k,includeContainer:t})[0]??e}function nt(e,t,r){rt(e,t)?.focus(r)}function it(e,t){if(e)return Q(e,{...k,includeContainer:t})[0]??e}function at(e,t,r){it(e,t)?.focus(r)}function wt(e,t){return Array.from(e.children).filter(r=>r.matches(t))}function ot(e,t){return e.filter(r=>r.matches(t))}function Ct(e,t,r){if(typeof t=="string"&&t!=="")return t;if(t===""||t===!0)return e[r]}function Nt(e,t){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)}function Et(e){return ct(e)||st(e)}function ut(e){return lt(e).filter(t=>t.nodeType===Node.TEXT_NODE).map(t=>t.textContent).join("").trim()}function It(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()!==""||t.nodeType===Node.ELEMENT_NODE)return!0;return!1}function st(e){return!!ut(e)}function lt(e){return e.currentTarget.assignedNodes({flatten:!0})}function ct(e){return!!ft(e).length}function ft(e,t){return dt(e.currentTarget,t)}function dt(e,t){let r=e.assignedElements({flatten:!0});return t?ot(r,t):r}function xt(e){return!!(e.isPrimary&&e.button===0)}function At(e){return e.detail===0}var Rt=(e,t,r,n=!0,i=!0,o=!1)=>{let a=e.indexOf(t),s=a===0,c=a===e.length-1;n&&(r=r==="previous"&&s?"last":r==="next"&&c?"first":r);let u;return r==="previous"?u=e[a-1]||e[n?e.length-1:a]:r==="next"?u=e[a+1]||e[n?0:a]:r==="last"?u=e[e.length-1]:u=e[0],et(u,i,"tabbable",o?u:void 0),u};function Ft(e,t){if(!e.parentNode||!t.parentNode||e.parentNode!==t.parentNode)return!1;let r=Array.from(e.parentNode.children);return r.indexOf(e)<r.indexOf(t)}async function Ot(e,t){return B(e,t,"animation")}async function Dt(e,t){return B(e,t,"transition")}function E(e,t,r){let n=t==="transition"?"transitionProperty":"animationName";return e.getAnimations().find(i=>i[n]===r)}async function B(e,t,r){let n=E(e,r,t);if(n||(await ht(),n=E(e,r,t)),!!n)try{await n.finished}catch{}}async function ht(){await new Promise(e=>requestAnimationFrame(()=>e()))}function kt(e){return e.endsWith("px")?parseFloat(e):e.endsWith("vw")?I(parseFloat(e),window.innerWidth):e.endsWith("vh")?I(parseFloat(e),window.innerHeight):0}function I(e,t){return e*t/100}export{k as a,gt as b,yt as c,pt as d,mt as e,S as f,St as g,Tt as h,_ as i,P as j,tt as k,et as l,rt as m,wt as n,Ct as o,Nt as p,Et as q,It as r,st as s,ct as t,ft as u,dt as v,xt as w,At as x,Rt as y,Ft as z,Ot as A,Dt as B,ht as C,kt as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as k,b as $,c as M,d as A}from"./P6DSHT3Y.js";import{a as m,b as n,c as o,h as r,j as u,k as d,m as f,n as h,p as D}from"./KSKQOJZX.js";import{j as C,k as z}from"./PN5LDURO.js";import"./YP3AYJH3.js";import{a as b}from"./SXMZWDUQ.js";import{a as E}from"./WCEPBGPF.js";import"./ZWPNZ5XW.js";import"./ZGO66DGC.js";import"./KD7UHFNY.js";import"./SOHXC2HB.js";import"./T6CCMW7H.js";import{G as x,H as S,S as R,g as y,h as v,p as g}from"./3PLEDPR4.js";var w=2,F={dateStyle:"full"},O={container:"container"},I=y`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:inline-block;inline-size:100%;overflow:visible;border-width:1px;border-style:solid;vertical-align:top;border-color:var(--calcite-date-picker-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-date-picker-corner-radius, 0)}:host([scale=s]){inline-size:236px;min-inline-size:216px;max-inline-size:380px}:host([scale=s][range][layout=horizontal][calendars="2"]){inline-size:480px;min-inline-size:432px;max-inline-size:772px}:host([scale=m]){inline-size:298px;min-inline-size:272px;max-inline-size:480px}:host([scale=m][layout=horizontal][range][calendars="2"]){inline-size:608px;min-inline-size:544px;max-inline-size:972px}:host([scale=l]){inline-size:334px;min-inline-size:320px;max-inline-size:600px}:host([scale=l][layout=horizontal][range][calendars="2"]){inline-size:684px;min-inline-size:640px;max-inline-size:1212px}.container{outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,p=class extends x{constructor(){super(),this.rangeValueChangedByUser=!1,this.messages=b({blocking:!0}),this.focusSetter=E()(this),this.calendars=2,this.layout="horizontal",this.monthStyle="wide",this.proximitySelectionDisabled=!1,this.range=!1,this.scale="m",this.calciteDatePickerChange=g({cancelable:!1}),this.calciteDatePickerRangeChange=g({cancelable:!1}),this.listen("keydown",this.keyDownHandler)}static{this.properties={activeEndDate:[16,{},{state:!0}],activeStartDate:[16,{},{state:!0}],dateTimeFormat:[16,{},{state:!0}],hoverRange:[16,{},{state:!0}],localeData:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],activeRange:[3,{},{reflect:!0}],calendars:[11,{},{type:Number,reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,numberingSystem:[3,{},{reflect:!0}],proximitySelectionDisabled:[7,{},{reflect:!0,type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.styles=I}async reset(){this.resetActiveDates(),this.rangeValueChangedByUser=!1}async setFocus(t){return this.focusSetter(()=>this.el,t)}async load(){await this.loadLocaleData()}willUpdate(t){t.has("value")&&this.valueHandler(this.value),t.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate);let e=A(t,"min"),a=A(t,"max");e==="min"?this.minAsDate=this.min?o(this.min):void 0:e==="minAsDate"&&(this.minAsDate=o(r(this.minAsDate))),a==="max"?this.maxAsDate=this.max?o(this.max):void 0:a==="maxAsDate"&&(this.maxAsDate=o(r(this.maxAsDate))),(t.has("range")&&this.range||t.has("maxAsDate")||t.has("minAsDate"))&&this.setActiveStartAndEndDates(),t.has("activeDate")&&this.hasUpdated&&this.activeDateWatcher(this.activeDate),t.has("messages")&&this.hasUpdated&&this.loadLocaleData().catch(console.error)}activeDateWatcher(t){this.range&&(t?(this.activeStartDate=t,this.activeEndDate=h(this.activeStartDate)):this.resetActiveDates())}valueHandler(t){Array.isArray(t)?(this.valueAsDate=M(t),this.rangeValueChangedByUser||this.resetActiveDates()):t&&(this.valueAsDate=o(t))}valueAsDateWatcher(t){this.range&&Array.isArray(t)&&!this.rangeValueChangedByUser?this.setActiveStartAndEndDates():!this.range&&t&&t!==this.activeDate&&(this.activeDate=t)}keyDownHandler(t){t.key==="Escape"&&this.resetActiveDates()}async loadLocaleData(){if(!1)return;let t=$(this.messages._lang);C.numberFormatOptions={numberingSystem:this.numberingSystem,locale:t,useGrouping:!1},this.localeData=await k(t),this.dateTimeFormat=z(t,F)}monthHeaderSelectChange(t){let e=new Date(t.detail.date),a=t.detail.position;this.range?a==="end"?(this.activeEndDate=e,this.activeStartDate=d(e)):(this.activeStartDate=e,this.activeEndDate=h(e)):this.activeDate=e,t.stopPropagation()}monthActiveDateChange(t){let e=new Date(t.detail);if(!this.range)this.activeDate=e;else{let a=e.getMonth(),i=a!==this.activeStartDate?.getMonth()&&(this.calendars===1||(this.activeStartDate?a!==h(this.activeStartDate).getMonth():!1));this.activeRange==="end"?(!this.activeEndDate||this.activeStartDate&&i)&&(this.activeEndDate=e,this.activeStartDate=d(e)):(this.activeStartDate&&i||!this.activeStartDate)&&(this.activeStartDate=e,this.activeEndDate=h(e))}t.stopPropagation()}monthHoverChange(t){if(!this.range){this.hoverRange=void 0;return}let{valueAsDate:e}=this,a=Array.isArray(e)?e[0]:void 0,i=Array.isArray(e)?e[1]:void 0,s=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:a,end:i},this.proximitySelectionDisabled)i&&a||!i&&a&&s>=a?(this.hoverRange.focused="end",this.hoverRange.end=s):!i&&a&&s<a?this.hoverRange={focused:"start",start:s,end:a}:this.hoverRange=void 0;else if(this.activeRange&&this.hoverRange)this.activeRange==="end"?(this.hoverRange.end=s,this.hoverRange.focused="end"):(this.hoverRange.start=s,this.hoverRange.focused="start");else if(a&&i){let c=Math.abs(D(s,a)),l=Math.abs(D(s,i));s>i?(this.hoverRange.end=s,this.hoverRange.focused="end"):s<a?(this.hoverRange.start=s,this.hoverRange.focused="start"):s>a&&s<i&&(c<l?(this.hoverRange.start=s,this.hoverRange.focused="start"):(this.hoverRange.end=s,this.hoverRange.focused="end"))}else a&&(s<a?this.hoverRange={focused:"start",start:s,end:a}:(this.hoverRange.end=s,this.hoverRange.focused="end"));t.stopPropagation()}monthMouseOutChange(t){this.hoverRange&&(this.hoverRange=void 0),t.stopPropagation()}resetActiveDates(){let{valueAsDate:t}=this;!Array.isArray(t)&&t&&t!==this.activeDate&&(this.activeDate=new Date(t)),Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate&&(this.activeStartDate=new Date(t[0])),t[1]&&t[1]!==this.activeEndDate&&(this.activeEndDate=new Date(t[1]))),this.hoverRange=void 0}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t,e=!0){let a=this.getStartDate();this.rangeValueChangedByUser=!0,this.value=[r(a),r(t)],this.valueAsDate=[a,t],e&&this.calciteDatePickerRangeChange.emit()}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0}setStartDate(t,e=!0){let a=this.getEndDate();this.rangeValueChangedByUser=!0,this.value=[r(t),r(a)],this.valueAsDate=[t,a],e&&this.calciteDatePickerRangeChange.emit()}monthDateChange(t){let e=new Date(t.detail),a=r(e);if(!this.range&&a===r(this.valueAsDate))return;if(!this.range){this.value=a||"",this.valueAsDate=e||void 0,this.activeDate=e||void 0,this.calciteDatePickerChange.emit();return}let i=this.getStartDate(),s=this.getEndDate();if(!i||!s&&e<i)i&&this.setEndDate(new Date(i)),this.activeRange=="end"?this.setEndDate(e):this.setStartDate(e);else if(!s)this.setEndDate(e);else if(this.proximitySelectionDisabled)this.setStartDate(e,!1),this.setEndDate(void 0,!1),this.calciteDatePickerRangeChange.emit();else if(this.activeRange)this.activeRange=="end"?this.setEndDate(e):(e>s&&(this.setEndDate(void 0,!1),this.activeEndDate=void 0),this.setStartDate(e));else{let c=D(e,i),l=D(e,s);l===0||c<0?this.setStartDate(e):c===0||l<0?this.setEndDate(e):c<l?this.setStartDate(e):this.setEndDate(e)}t.stopPropagation(),this.calciteDatePickerChange.emit()}getActiveDate(t,e,a){let i=n(new Date,e,a);return n(this.activeDate,e,a)||t||(u(a,i)&&!this.range?f(i,e,a):i)}getActiveEndDate(t,e,a){return n(this.activeEndDate,e,a)||t||n(h(new Date),e,a)}setActiveStartAndEndDates(){if(this.range){let t=n(Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=n(Array.isArray(this.valueAsDate)?this.valueAsDate[1]:void 0,this.minAsDate,this.maxAsDate);if(this.activeStartDate=this.getActiveDate(t,this.minAsDate,this.maxAsDate),this.activeEndDate=this.getActiveEndDate(e,this.minAsDate,this.maxAsDate),u(this.activeStartDate,this.activeEndDate)){let a=f(this.activeEndDate?d(this.activeEndDate):void 0,this.minAsDate,this.maxAsDate),i=this.activeEndDate?h(this.activeEndDate):void 0;m(a,this.minAsDate,this.maxAsDate)?this.activeStartDate=a:m(i,this.minAsDate,this.maxAsDate)&&(this.activeEndDate=i)}}}render(){let t=n(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.getActiveDate(t,this.minAsDate,this.maxAsDate),a=this.range&&Array.isArray(this.valueAsDate)?n(this.valueAsDate[1],this.minAsDate,this.maxAsDate):void 0,i=this.range&&this.activeRange?this.activeRange==="start"?this.minAsDate:t:this.minAsDate,s=this.range?this.activeStartDate:e;return v`<div aria-hidden class=${S(O.container)} tabindex=-1>${this.renderMonth(s,this.maxAsDate,i,t,a)}</div>`}renderMonth(t,e,a,i,s){return v`<calcite-date-picker-month .activeDate=${t} .calendars=${this.calendars} .dateTimeFormat=${this.dateTimeFormat} .endDate=${this.range?s:void 0} .headingLevel=${this.headingLevel||w} .hoverRange=${this.hoverRange} .layout=${this.layout} .localeData=${this.localeData} .max=${e} .messages=${this.messages} .min=${a} .monthStyle=${this.monthStyle} @calciteInternalDatePickerDayHover=${this.monthHoverChange} @calciteInternalDatePickerDaySelect=${this.monthDateChange} @calciteInternalDatePickerMonthActiveDateChange=${this.monthActiveDateChange} @calciteInternalDatePickerMonthChange=${this.monthHeaderSelectChange} @calciteInternalDatePickerMonthMouseOut=${this.monthMouseOutChange} .range=${this.range} .scale=${this.scale} .selectedDate=${this.activeRange==="end"?s:i} .startDate=${this.range?i:void 0}></calcite-date-picker-month>`}};R("calcite-date-picker",p);export{p as DatePicker};
|
|
2
|
+
import{a as k,b as $,c as M,d as A}from"./6P5O53FC.js";import{a as m,b as n,c as o,h as r,j as u,k as d,m as f,n as h,p as D}from"./5RU4WRDH.js";import{j as C,k as z}from"./W5QIPFSJ.js";import"./YP3AYJH3.js";import{a as b}from"./KVCFGTZC.js";import{a as E}from"./ADXJH4JG.js";import"./ZWPNZ5XW.js";import"./BKBRE6BE.js";import"./NRGZYLHS.js";import"./RJUGARBU.js";import"./T6CCMW7H.js";import{G as x,H as S,S as R,g as y,h as v,p as g}from"./OD4W6GP7.js";var w=2,F={dateStyle:"full"},O={container:"container"},I=y`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:inline-block;inline-size:100%;overflow:visible;border-width:1px;border-style:solid;vertical-align:top;border-color:var(--calcite-date-picker-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-date-picker-corner-radius, 0)}:host([scale=s]){inline-size:236px;min-inline-size:216px;max-inline-size:380px}:host([scale=s][range][layout=horizontal][calendars="2"]){inline-size:480px;min-inline-size:432px;max-inline-size:772px}:host([scale=m]){inline-size:298px;min-inline-size:272px;max-inline-size:480px}:host([scale=m][layout=horizontal][range][calendars="2"]){inline-size:608px;min-inline-size:544px;max-inline-size:972px}:host([scale=l]){inline-size:334px;min-inline-size:320px;max-inline-size:600px}:host([scale=l][layout=horizontal][range][calendars="2"]){inline-size:684px;min-inline-size:640px;max-inline-size:1212px}.container{outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,p=class extends x{constructor(){super(),this.rangeValueChangedByUser=!1,this.messages=b({blocking:!0}),this.focusSetter=E()(this),this.calendars=2,this.layout="horizontal",this.monthStyle="wide",this.proximitySelectionDisabled=!1,this.range=!1,this.scale="m",this.calciteDatePickerChange=g({cancelable:!1}),this.calciteDatePickerRangeChange=g({cancelable:!1}),this.listen("keydown",this.keyDownHandler)}static{this.properties={activeEndDate:[16,{},{state:!0}],activeStartDate:[16,{},{state:!0}],dateTimeFormat:[16,{},{state:!0}],hoverRange:[16,{},{state:!0}],localeData:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],activeRange:[3,{},{reflect:!0}],calendars:[11,{},{type:Number,reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,numberingSystem:[3,{},{reflect:!0}],proximitySelectionDisabled:[7,{},{reflect:!0,type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.styles=I}async reset(){this.resetActiveDates(),this.rangeValueChangedByUser=!1}async setFocus(t){return this.focusSetter(()=>this.el,t)}async load(){await this.loadLocaleData()}willUpdate(t){t.has("value")&&this.valueHandler(this.value),t.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate);let e=A(t,"min"),a=A(t,"max");e==="min"?this.minAsDate=this.min?o(this.min):void 0:e==="minAsDate"&&(this.minAsDate=o(r(this.minAsDate))),a==="max"?this.maxAsDate=this.max?o(this.max):void 0:a==="maxAsDate"&&(this.maxAsDate=o(r(this.maxAsDate))),(t.has("range")&&this.range||t.has("maxAsDate")||t.has("minAsDate"))&&this.setActiveStartAndEndDates(),t.has("activeDate")&&this.hasUpdated&&this.activeDateWatcher(this.activeDate),t.has("messages")&&this.hasUpdated&&this.loadLocaleData().catch(console.error)}activeDateWatcher(t){this.range&&(t?(this.activeStartDate=t,this.activeEndDate=h(this.activeStartDate)):this.resetActiveDates())}valueHandler(t){Array.isArray(t)?(this.valueAsDate=M(t),this.rangeValueChangedByUser||this.resetActiveDates()):t&&(this.valueAsDate=o(t))}valueAsDateWatcher(t){this.range&&Array.isArray(t)&&!this.rangeValueChangedByUser?this.setActiveStartAndEndDates():!this.range&&t&&t!==this.activeDate&&(this.activeDate=t)}keyDownHandler(t){t.key==="Escape"&&this.resetActiveDates()}async loadLocaleData(){if(!1)return;let t=$(this.messages._lang);C.numberFormatOptions={numberingSystem:this.numberingSystem,locale:t,useGrouping:!1},this.localeData=await k(t),this.dateTimeFormat=z(t,F)}monthHeaderSelectChange(t){let e=new Date(t.detail.date),a=t.detail.position;this.range?a==="end"?(this.activeEndDate=e,this.activeStartDate=d(e)):(this.activeStartDate=e,this.activeEndDate=h(e)):this.activeDate=e,t.stopPropagation()}monthActiveDateChange(t){let e=new Date(t.detail);if(!this.range)this.activeDate=e;else{let a=e.getMonth(),i=a!==this.activeStartDate?.getMonth()&&(this.calendars===1||(this.activeStartDate?a!==h(this.activeStartDate).getMonth():!1));this.activeRange==="end"?(!this.activeEndDate||this.activeStartDate&&i)&&(this.activeEndDate=e,this.activeStartDate=d(e)):(this.activeStartDate&&i||!this.activeStartDate)&&(this.activeStartDate=e,this.activeEndDate=h(e))}t.stopPropagation()}monthHoverChange(t){if(!this.range){this.hoverRange=void 0;return}let{valueAsDate:e}=this,a=Array.isArray(e)?e[0]:void 0,i=Array.isArray(e)?e[1]:void 0,s=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:a,end:i},this.proximitySelectionDisabled)i&&a||!i&&a&&s>=a?(this.hoverRange.focused="end",this.hoverRange.end=s):!i&&a&&s<a?this.hoverRange={focused:"start",start:s,end:a}:this.hoverRange=void 0;else if(this.activeRange&&this.hoverRange)this.activeRange==="end"?(this.hoverRange.end=s,this.hoverRange.focused="end"):(this.hoverRange.start=s,this.hoverRange.focused="start");else if(a&&i){let c=Math.abs(D(s,a)),l=Math.abs(D(s,i));s>i?(this.hoverRange.end=s,this.hoverRange.focused="end"):s<a?(this.hoverRange.start=s,this.hoverRange.focused="start"):s>a&&s<i&&(c<l?(this.hoverRange.start=s,this.hoverRange.focused="start"):(this.hoverRange.end=s,this.hoverRange.focused="end"))}else a&&(s<a?this.hoverRange={focused:"start",start:s,end:a}:(this.hoverRange.end=s,this.hoverRange.focused="end"));t.stopPropagation()}monthMouseOutChange(t){this.hoverRange&&(this.hoverRange=void 0),t.stopPropagation()}resetActiveDates(){let{valueAsDate:t}=this;!Array.isArray(t)&&t&&t!==this.activeDate&&(this.activeDate=new Date(t)),Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate&&(this.activeStartDate=new Date(t[0])),t[1]&&t[1]!==this.activeEndDate&&(this.activeEndDate=new Date(t[1]))),this.hoverRange=void 0}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t,e=!0){let a=this.getStartDate();this.rangeValueChangedByUser=!0,this.value=[r(a),r(t)],this.valueAsDate=[a,t],e&&this.calciteDatePickerRangeChange.emit()}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0}setStartDate(t,e=!0){let a=this.getEndDate();this.rangeValueChangedByUser=!0,this.value=[r(t),r(a)],this.valueAsDate=[t,a],e&&this.calciteDatePickerRangeChange.emit()}monthDateChange(t){let e=new Date(t.detail),a=r(e);if(!this.range&&a===r(this.valueAsDate))return;if(!this.range){this.value=a||"",this.valueAsDate=e||void 0,this.activeDate=e||void 0,this.calciteDatePickerChange.emit();return}let i=this.getStartDate(),s=this.getEndDate();if(!i||!s&&e<i)i&&this.setEndDate(new Date(i)),this.activeRange=="end"?this.setEndDate(e):this.setStartDate(e);else if(!s)this.setEndDate(e);else if(this.proximitySelectionDisabled)this.setStartDate(e,!1),this.setEndDate(void 0,!1),this.calciteDatePickerRangeChange.emit();else if(this.activeRange)this.activeRange=="end"?this.setEndDate(e):(e>s&&(this.setEndDate(void 0,!1),this.activeEndDate=void 0),this.setStartDate(e));else{let c=D(e,i),l=D(e,s);l===0||c<0?this.setStartDate(e):c===0||l<0?this.setEndDate(e):c<l?this.setStartDate(e):this.setEndDate(e)}t.stopPropagation(),this.calciteDatePickerChange.emit()}getActiveDate(t,e,a){let i=n(new Date,e,a);return n(this.activeDate,e,a)||t||(u(a,i)&&!this.range?f(i,e,a):i)}getActiveEndDate(t,e,a){return n(this.activeEndDate,e,a)||t||n(h(new Date),e,a)}setActiveStartAndEndDates(){if(this.range){let t=n(Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=n(Array.isArray(this.valueAsDate)?this.valueAsDate[1]:void 0,this.minAsDate,this.maxAsDate);if(this.activeStartDate=this.getActiveDate(t,this.minAsDate,this.maxAsDate),this.activeEndDate=this.getActiveEndDate(e,this.minAsDate,this.maxAsDate),u(this.activeStartDate,this.activeEndDate)){let a=f(this.activeEndDate?d(this.activeEndDate):void 0,this.minAsDate,this.maxAsDate),i=this.activeEndDate?h(this.activeEndDate):void 0;m(a,this.minAsDate,this.maxAsDate)?this.activeStartDate=a:m(i,this.minAsDate,this.maxAsDate)&&(this.activeEndDate=i)}}}render(){let t=n(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.getActiveDate(t,this.minAsDate,this.maxAsDate),a=this.range&&Array.isArray(this.valueAsDate)?n(this.valueAsDate[1],this.minAsDate,this.maxAsDate):void 0,i=this.range&&this.activeRange?this.activeRange==="start"?this.minAsDate:t:this.minAsDate,s=this.range?this.activeStartDate:e;return v`<div aria-hidden class=${S(O.container)} tabindex=-1>${this.renderMonth(s,this.maxAsDate,i,t,a)}</div>`}renderMonth(t,e,a,i,s){return v`<calcite-date-picker-month .activeDate=${t} .calendars=${this.calendars} .dateTimeFormat=${this.dateTimeFormat} .endDate=${this.range?s:void 0} .headingLevel=${this.headingLevel||w} .hoverRange=${this.hoverRange} .layout=${this.layout} .localeData=${this.localeData} .max=${e} .messages=${this.messages} .min=${a} .monthStyle=${this.monthStyle} @calciteInternalDatePickerDayHover=${this.monthHoverChange} @calciteInternalDatePickerDaySelect=${this.monthDateChange} @calciteInternalDatePickerMonthActiveDateChange=${this.monthActiveDateChange} @calciteInternalDatePickerMonthChange=${this.monthHeaderSelectChange} @calciteInternalDatePickerMonthMouseOut=${this.monthMouseOutChange} .range=${this.range} .scale=${this.scale} .selectedDate=${this.activeRange==="end"?s:i} .startDate=${this.range?i:void 0}></calcite-date-picker-month>`}};R("calcite-date-picker",p);export{p as DatePicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as b,b as v,j as o,m as C,n as I,q as w}from"./KSKQOJZX.js";import"./PN5LDURO.js";import{a as F}from"./UVD3MS5W.js";import"./YP3AYJH3.js";import"./KD7UHFNY.js";import{F as $,G as A,H as u,S as R,g as x,h as g,p as y}from"./3PLEDPR4.js";var D={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",month:"month",noncurrent:"noncurrent",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,m=7,M=6,P=42,S=class extends A{constructor(){super(),this.activeFocus=!1,this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=y({cancelable:!1}),this.calciteInternalDatePickerDaySelect=y({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=y({cancelable:!1}),this.calciteInternalDatePickerMonthChange=y({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=y({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),r=[];if(n===(t+M)%m)return r;if(n===t)return[i];for(let l=(m+n-t)%m;l>=0;l--)r.push(i-l);return r}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%m)return i;for(let n=0;n<(M-(s-t))%m;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(o(e,this.selectedDate)||this.startDate&&o(e,this.startDate)||this.endDate&&o(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!o(this.startDate,this.endDate)&&o(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!o(this.startDate,this.endDate)&&o(this.endDate,e)||!this.endDate&&this.hoverRange&&o(this.startDate,this.hoverRange.end)&&o(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a&&a>this.startDate,i=this.endDate&&a&&a<this.endDate,n=this.startDate&&e&&e>this.startDate,r=this.endDate&&e&&e<this.endDate,l=!t&&this.startDate&&s&&(!this.endDate||i),c=t&&this.startDate&&n&&r;return!!(l||c)}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=!!(a&&e>a&&this.startDate&&e<this.startDate),r=!!(t&&e<t&&this.endDate&&e>this.endDate),l=!!(t&&e>t&&this.endDate&&e<this.endDate),c=!!(a&&e<a&&this.startDate&&e>this.startDate),h=!!(t&&e<t&&this.startDate&&e>this.startDate),d=!!(a&&e>a&&this.endDate&&e<this.endDate),f=this.startDate&&this.endDate;if(i){if(f)return s?!!(this.endDate&&e<this.endDate)&&(c||n):l||r;if(this.startDate&&!this.endDate)return s?n:h;if(!this.startDate&&this.endDate)return s?d:r}else if(f)return s?n:r;return!1}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let r=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,date:new Date(r,i-1,c)})),...a.map(c=>{let h=new Date(r,i,c),d=o(h,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?o(h,this.focusedDate):o(h,this.startDate)||o(h,this.endDate),currentMonth:!0,currentDay:d,day:c,date:h}}),...t.map(c=>({active:!1,day:c,date:new Date(r,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:C(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,r=this.scale==="s"?n||i||s:i||s||n,l=[...r.slice(t,7),...r.slice(0,t)],c=this.getCurrentMonthDays(e,a),h=this.getPreviousMonthDays(e,a,t),d=this.getNextMonthDays(e,a,t),f=c.length+h.length+d.length;if(f<P){let N=d.length?d[d.length-1]:0;for(let k=1;k<=P-f;k++)d.push(N+k)}let p=e+1,H=this.getPreviousMonthDays(p,a,t),E=this.getCurrentMonthDays(p,a),z=this.getNextMonthDays(p,a,t),O=this.getDays(h,c,d),B=this.getDays(H,E,z,"end");return g`<div class=${u({[D.calendarContainer]:!0})} role=grid>${this.renderCalendar(l,O)}${this.range&&this.calendars===2&&this.renderCalendar(l,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i},n){let r=b(s,this.min,this.max);return F(n,g`<div class=${u({[D.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[D.currentDay]:t,[D.noncurrent]:this.range&&this.calendars===2&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!o(this.startDate,this.endDate)} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${$(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[D.calendar]:!0,[D.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?I(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":void 0} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[D.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[D.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[D.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[D.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};R("calcite-date-picker-month",S);export{S as DatePickerMonth};
|
|
2
|
+
import{a as b,b as v,j as o,m as C,n as I,q as w}from"./5RU4WRDH.js";import"./W5QIPFSJ.js";import{a as F}from"./TQOSF3DK.js";import"./YP3AYJH3.js";import"./NRGZYLHS.js";import{F as $,G as A,H as u,S as R,g as x,h as g,p as y}from"./OD4W6GP7.js";var D={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",month:"month",noncurrent:"noncurrent",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,m=7,M=6,P=42,S=class extends A{constructor(){super(),this.activeFocus=!1,this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=y({cancelable:!1}),this.calciteInternalDatePickerDaySelect=y({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=y({cancelable:!1}),this.calciteInternalDatePickerMonthChange=y({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=y({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),r=[];if(n===(t+M)%m)return r;if(n===t)return[i];for(let l=(m+n-t)%m;l>=0;l--)r.push(i-l);return r}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%m)return i;for(let n=0;n<(M-(s-t))%m;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(o(e,this.selectedDate)||this.startDate&&o(e,this.startDate)||this.endDate&&o(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!o(this.startDate,this.endDate)&&o(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!o(this.startDate,this.endDate)&&o(this.endDate,e)||!this.endDate&&this.hoverRange&&o(this.startDate,this.hoverRange.end)&&o(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a&&a>this.startDate,i=this.endDate&&a&&a<this.endDate,n=this.startDate&&e&&e>this.startDate,r=this.endDate&&e&&e<this.endDate,l=!t&&this.startDate&&s&&(!this.endDate||i),c=t&&this.startDate&&n&&r;return!!(l||c)}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=!!(a&&e>a&&this.startDate&&e<this.startDate),r=!!(t&&e<t&&this.endDate&&e>this.endDate),l=!!(t&&e>t&&this.endDate&&e<this.endDate),c=!!(a&&e<a&&this.startDate&&e>this.startDate),h=!!(t&&e<t&&this.startDate&&e>this.startDate),d=!!(a&&e>a&&this.endDate&&e<this.endDate),f=this.startDate&&this.endDate;if(i){if(f)return s?!!(this.endDate&&e<this.endDate)&&(c||n):l||r;if(this.startDate&&!this.endDate)return s?n:h;if(!this.startDate&&this.endDate)return s?d:r}else if(f)return s?n:r;return!1}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let r=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,date:new Date(r,i-1,c)})),...a.map(c=>{let h=new Date(r,i,c),d=o(h,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?o(h,this.focusedDate):o(h,this.startDate)||o(h,this.endDate),currentMonth:!0,currentDay:d,day:c,date:h}}),...t.map(c=>({active:!1,day:c,date:new Date(r,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:C(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,r=this.scale==="s"?n||i||s:i||s||n,l=[...r.slice(t,7),...r.slice(0,t)],c=this.getCurrentMonthDays(e,a),h=this.getPreviousMonthDays(e,a,t),d=this.getNextMonthDays(e,a,t),f=c.length+h.length+d.length;if(f<P){let N=d.length?d[d.length-1]:0;for(let k=1;k<=P-f;k++)d.push(N+k)}let p=e+1,H=this.getPreviousMonthDays(p,a,t),E=this.getCurrentMonthDays(p,a),z=this.getNextMonthDays(p,a,t),O=this.getDays(h,c,d),B=this.getDays(H,E,z,"end");return g`<div class=${u({[D.calendarContainer]:!0})} role=grid>${this.renderCalendar(l,O)}${this.range&&this.calendars===2&&this.renderCalendar(l,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i},n){let r=b(s,this.min,this.max);return F(n,g`<div class=${u({[D.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[D.currentDay]:t,[D.noncurrent]:this.range&&this.calendars===2&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!o(this.startDate,this.endDate)} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${$(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[D.calendar]:!0,[D.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?I(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":void 0} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[D.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[D.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[D.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[D.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};R("calcite-date-picker-month",S);export{S as DatePickerMonth};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as g,c as x}from"./YJPIZ6DX.js";import{b as h,f as F,g as $,j as b,k as N}from"./PN5LDURO.js";import{a as U}from"./EO5N74I3.js";import{b as w}from"./YP3AYJH3.js";import{d as O}from"./ZGO66DGC.js";import{p as y,r as H}from"./3PLEDPR4.js";var C=5;function A({locale:r,numberingSystem:e,includeSeconds:n,fractionalSecondDigits:t,hour12:i}){let s={hour:"2-digit",minute:"2-digit",timeZone:"UTC",numberingSystem:$(e)};return typeof i=="boolean"&&(s.hour12=i),n&&(s.second="2-digit",t&&(s.fractionalSecondDigits=t)),N(r,s)}function L(r,e){return parseFloat(`0.${r}`).toFixed(g(e)).replace("0.","")}function D(r,e){if(r==null)return;let n=r.toString(),t=g(r);if(r<1&&t>0&&t<4){let i=n.replace("0.","");return!e||i.length===e?i:i.length<e?i.padEnd(e,"0"):i}if(r>=0&&r<10)return n.padStart(2,"0");if(r>=10)return n}function _(r){return parseInt((parseFloat(`0.${r}`)/.001).toFixed(3),10)}function q(r){let e={locale:r};return r==="mk"?e.hour12=!1:r.toLowerCase()==="es-mx"&&(e.hour12=!0),A(e).formatToParts(new Date(Date.UTC(0,0,0,0,0,0))).find(({type:i})=>i==="dayPeriod")?.value?"12":"24"}function W({locale:r,meridiem:e,parts:n}){let t=["he","bs","mk"],i;if(n){if(i=n.find(({type:s})=>s==="dayPeriod")?.value||null,r&&t.includes(r)){let s=F.get(r);i==="PM"&&(i=s.pm),i==="AM"&&(i=s.am)}}else if(e)if(t.includes(r)){let s=F.get(r);i=e==="PM"?s.pm:s.am}else{let s=A({locale:r,hour12:!0}),o=6,a=18,c=new Date(Date.UTC(0,0,0,e==="AM"?o:a,0));i=s.formatToParts(c).find(({type:f})=>f==="dayPeriod")?.value||null}return i}function k(r,e){return b.numberFormatOptions={locale:r,numberingSystem:e},b.localize("1.1").split("")[1]}function I({hour12:r,locale:e,numberingSystem:n="latn",part:t,step:i}){let o=A({hour12:r,includeSeconds:i<60,locale:e,numberingSystem:n}).formatToParts(new Date(Date.UTC(0,0,0,0,0,0)));return S(`${t}Suffix`,o,e)}function S(r,e,n="en"){if(!r||!e)return null;if(r==="hourSuffix"){let t=e.find(({type:c})=>c==="hour"),i=e.find(({type:c})=>c==="minute"),s=t?e.indexOf(t):-1,o=i?e.indexOf(i):-1,a=e[s+1];return a?.type==="literal"&&o-s===2&&a.value||null}if(r==="minuteSuffix"){let t=e.find(({type:o})=>o==="minute"),i=t?e.indexOf(t):-1,s=e[i+1];return s?.type==="literal"&&s.value||null}if(r==="secondSuffix"){let t,i=e.find(({type:o})=>o==="fractionalSecond"),s=i?e.indexOf(i):-1;if(s!==-1)t=e[s+1];else{let o=e.find(({type:c})=>c==="second"),a=o?e.indexOf(o):-1;t=e[a+1]}return t?.type==="literal"&&t.value||null}return r==="meridiem"&&(e.find(({type:i})=>i==="dayPeriod")?.value||null)?W({locale:n,parts:e})??null:e.find(({type:t})=>t===r)?.value||null}function B(r){if(!h(r))return null;let e=parseInt(r,10);return e>=0&&e<=11?"AM":"PM"}function Z(r){return new Intl.DateTimeFormat(r,{hour:"2-digit",hour12:!0,minute:"2-digit",timeZone:"UTC"}).formatToParts(new Date(Date.UTC(0,0,0,0,0))).findIndex(t=>t.type==="dayPeriod")}function z(r){let e=typeof r=="string";if(!r||e&&(r.startsWith(":")||r.endsWith(":"))||!e&&(!r.hour||!r.minute))return!1;let n,t,i;if(e?[n,t,i]=r.split(":"):{hour:n,minute:t,second:i}=r,!n||!t)return!1;let s=parseInt(n,10),o=parseInt(t,10),a=parseInt(i??"",10),c=h(n)&&s>=0&&s<24,u=h(t)&&o>=0&&o<60,f=h(i)&&a>=0&&a<60;return c&&u&&(!i||f)}function v(r,e){if(e==="meridiem")return r==="AM"||r==="PM";if(!h(r))return!1;let t=Number(r),i=t>=0,s=t<24,o=t<60,a=t<=999;return e==="hour"?i&&s:e==="fractionalSecond"?i&&a:i&&o}function V({value:r,part:e,locale:n,numberingSystem:t="latn",hour12:i}){if(!v(r,e))return;if(e==="fractionalSecond"){let f=k(n,t),m=null;if(r){b.numberFormatOptions={locale:n,numberingSystem:t};let p=b.localize("0");parseInt(r,10)===0?m="".padStart(r.length,p):(m=b.localize(`0.${r}`).replace(`${p}${f}`,""),m.length<r.length&&(m=m.padEnd(r.length,p)))}return m}let s=parseInt(r,10),o=new Date(Date.UTC(0,0,0,e==="hour"?s:e==="meridiem"?r==="AM"?0:12:0,e==="minute"?s:0,e==="second"?s:0));if(!o)return;let a=["second","fractionalSecond"].includes(e),u=A({hour12:i,includeSeconds:a,locale:n,numberingSystem:t}).formatToParts(o);return S(e,u,n)}function G({hour12:r,locale:e,numberingSystem:n="latn",parts:t=!1,step:i,value:s}){if(!z(s))return null;let{hour:o,minute:a,second:c="0",fractionalSecond:u}=K(s,i),f=i<60,m=new Date(Date.UTC(0,0,0,parseInt(o,10),parseInt(a,10),f&&typeof c=="string"?parseInt(c,10):0,f&&u?_(u):0)),p=A({fractionalSecondDigits:g(i),hour12:r,includeSeconds:f,locale:e,numberingSystem:n});if(t){let l=p.formatToParts(m);return{hour:S("hour",l),hourSuffix:S("hourSuffix",l),minute:S("minute",l),minuteSuffix:S("minuteSuffix",l),second:S("second",l),decimalSeparator:k(e,n),fractionalSecond:S("fractionalSecond",l),secondSuffix:e!=="bg"?S("secondSuffix",l):null,meridiem:S("meridiem",l,e)}}else{let l=p.format(m)||null;if(!t&&typeof l=="string"&&e==="bg"&&l&&l.includes(" \u0447.")&&(l=l.replaceAll(" \u0447.","")),["he","bs","mk"].includes(e)){let d=F.get(e);l.includes("AM")?l=l.replaceAll("AM",d.am):l.includes("PM")&&(l=l.replaceAll("PM",d.pm)),e!=="he"&&l.indexOf(".")!==l.length-1&&(l=l.replace(".",","))}return l}}function K(r,e){if(z(r)){let[n,t,i]=r.split(":"),s=i,o=null;return i?.includes(".")&&([s,o]=i.split(".")),e&&typeof o=="string"&&(o=L(o,e)),{fractionalSecond:o,hour:n,minute:t,second:s}}return{fractionalSecond:null,hour:null,minute:null,second:null}}function E(r,e=60){if(!z(r))return null;let n,t,i,s,o,a=null;return typeof r=="string"?([n,t,s]=r.split(":"),[i,o]=s?.split(".")||["0"]):(n=r.hour,t=r.minute,i=r.second,o=r.fractionalSecond),n&&t&&(a=`${D(parseInt(n,10))}:${D(parseInt(t,10))}`,e<60&&(a+=`:${D(parseInt(i||"0",10))}`,e<1&&(a+=`.${L(o||"0",e)}`))),a}var T=class extends H{constructor(){super(...arguments),this.localizedDecimalSeparator=".",this.userChangedValue=!1,this.handleHourKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(h(this.hour))switch(this.hourFormat){case"12":i=this.hour==="01"&&t>=0&&t<=2?`1${t}`:t;break;case"24":this.hour==="01"?i=`1${t}`:this.hour==="02"&&t>=0&&t<=3?i=`2${t}`:i=t;break}else i=t;this.setValuePart("hour",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("hour",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementHour();break;case"ArrowUp":e.preventDefault(),this.incrementHour();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleMinuteKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(typeof this.minute=="string"&&h(this.minute)&&this.minute.startsWith("0")){let s=parseInt(this.minute,10);i=s>C?t:`${s}${t}`}else i=t;this.setValuePart("minute",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("minute",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementMinute();break;case"ArrowUp":e.preventDefault(),this.incrementMinute();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleSecondKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(typeof this.second=="string"&&h(this.second)&&this.second.startsWith("0")){let s=parseInt(this.second,10);i=s>C?t:`${s}${t}`}else i=t;this.setValuePart("second",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("second",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementSecond();break;case"ArrowUp":e.preventDefault(),this.incrementSecond();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleFractionalSecondKeyDownEvent=e=>{let{key:n}=e;if(w.includes(n)){let t=g(this.component.step),i=parseInt(this.fractionalSecond,10),s=i.toString().length,o;s>=t?o=n.padStart(t,"0"):s<t&&(o=`${i}${n}`.padStart(t,"0")),this.setValuePart("fractionalSecond",parseFloat(`0.${o}`))}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("fractionalSecond",void 0);break;case"ArrowDown":e.preventDefault(),this.nudgeFractionalSecond("down");break;case"ArrowUp":e.preventDefault(),this.nudgeFractionalSecond("up");break;case" ":e.preventDefault();break}},this.handleMeridiemKeyDownEvent=e=>{switch(e.key){case"a":this.setValuePart("meridiem","AM");break;case"p":this.setValuePart("meridiem","PM");break;case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("meridiem");break;case"ArrowUp":e.preventDefault(),this.toggleMeridiem("up");break;case"ArrowDown":e.preventDefault(),this.toggleMeridiem("down");break;case" ":case"Spacebar":e.preventDefault();break}},this.calciteTimeChange=y()}get hasValue(){return!!(this?.hour||this?.minute||this?.second||this?.fractionalSecond||this?.meridiem)}decrementHour(){let e=this.hour?this.hour==="00"?23:parseInt(this.hour,10)-1:0;this.setValuePart("hour",e)}decrementMinute(){this.decrementMinuteOrSecond("minute")}decrementSecond(){this.decrementMinuteOrSecond("second")}incrementHour(){let e=typeof this.hour=="string"&&h(this.hour)?this.hour==="23"?0:parseInt(this.hour,10)+1:1;this.setValuePart("hour",e)}incrementMinute(){this.incrementMinuteOrSecond("minute")}incrementSecond(){this.incrementMinuteOrSecond("second")}nudgeFractionalSecond(e){let n=x(this.component.step),t=g(this.component.step),i=parseInt(this.fractionalSecond,10),s=parseFloat(`0.${this.fractionalSecond}`),o,a,c,u;e==="up"&&(o=isNaN(i)?0:s+n,a=parseFloat(o.toFixed(t)),c=x(a),u=a<1&&g(c)>0?D(c,t):"".padStart(t,"0")),e==="down"&&(o=isNaN(i)||i===0?1-n:s-n,a=parseFloat(o.toFixed(t)),c=x(a),u=a<1&&g(c)>0&&Math.sign(c)===1?D(c,t):"".padStart(t,"0")),this.setValuePart("fractionalSecond",u)}toggleMeridiem(e){let n;this.meridiem?n=this.meridiem==="AM"?"PM":"AM":n=e==="down"?"PM":"AM",this.setValuePart("meridiem",n)}hostConnected(){this.setHourFormat(),this.setMeridiemOrder(),this.setValue(this.component.value)}hostUpdate(e){let n=!1,t=!1,i=!1;if(e.has("hourFormat")&&(n=!0,i=!0),e.has("messages")&&e.get("messages")?._lang!==this.component.messages._lang&&(n=!0,t=!0,i=!0),e.has("numberingSystem")&&(i=!0),e.has("step")){let s=this.component.step,o=e.get("step");(s>=60&&o>0&&o<60||o>=60&&s>0&&s<60)&&(i=!0)}n&&this.setHourFormat(),t&&this.setMeridiemOrder(),i&&this.setValue(this.component.value),this.userChangedValue=!1}decrementMinuteOrSecond(e){let n;if(h(this[e])){let t=parseInt(this[e],10);n=t===0?59:t-1}else n=59;this.setValuePart(e,n)}incrementMinuteOrSecond(e){let n=h(this[e])?this[e]==="59"?0:parseInt(this[e],10)+1:0;this.setValuePart(e,n)}setHourFormat(){let{hourFormat:e,messages:n}=this.component;this.hourFormat=e==="user"?q(n._lang):e}setMeridiemOrder(){let{messages:e}=this.component;this.meridiemOrder=Z(e._lang)}setValue(e,n=!1){let{messages:t,numberingSystem:i,step:s,value:o}=this.component,a=t._lang,c=this.hourFormat==="12",u=E(e,s);if(z(e)){let{hour:f,minute:m,second:p,fractionalSecond:l}=K(u,s),d=G({hour12:c,locale:a,numberingSystem:i,parts:!0,step:s,value:u});this.hour=f,this.minute=m,this.second=p,this.fractionalSecond=l,d&&(this.localizedHour=d.hour,this.localizedHourSuffix=d.hourSuffix,this.localizedMinute=d.minute,this.localizedMinuteSuffix=d.minuteSuffix,this.localizedSecond=d.second,this.localizedDecimalSeparator=d.decimalSeparator,this.localizedFractionalSecond=d.fractionalSecond,this.localizedSecondSuffix=d.secondSuffix,d.meridiem&&(this.meridiem=B(this.hour),this.localizedMeridiem=d.meridiem))}else this.hour=null,this.minute=null,this.second=null,this.fractionalSecond=null,this.meridiem=null,this.localizedHour=null,this.localizedHourSuffix=I({hour12:c,part:"hour",locale:a,numberingSystem:i,step:s}),this.localizedMinute=null,this.localizedMinuteSuffix=I({hour12:c,part:"minute",locale:a,numberingSystem:i,step:s}),this.localizedSecond=null,this.localizedDecimalSeparator=k(a,i),this.localizedFractionalSecond=null,this.localizedSecondSuffix=I({hour12:c,part:"second",locale:a,numberingSystem:i,step:s}),this.localizedMeridiem=null;u!==o?(this.userChangedValue=n,this.component.value=u??""):this.component.requestUpdate()}setValuePart(e,n){let{hourFormat:t}=this,{messages:i,numberingSystem:s,step:o}=this.component,a=i._lang,c=t==="12",u=this.component.value;if(e==="meridiem"){let P=this.meridiem;if(this.meridiem=n,this.localizedMeridiem=V({hour12:c,locale:a,numberingSystem:s,part:"meridiem",value:this.meridiem}),h(this.hour)){let M=parseInt(this.hour,10);switch(n){case"AM":M>=12&&(this.hour=D(M-12));break;case"PM":M<12&&(this.hour=D(M+12));break;default:this.userChangedValue=!0,this.component.value="";break}this.localizedHour=V({hour12:c,locale:a,numberingSystem:s,part:"hour",value:this.hour})}P!==this.meridiem&&this.component.requestUpdate()}else if(e==="fractionalSecond"){let P=this.fractionalSecond,M=g(o);typeof n=="number"?this.fractionalSecond=n===0?"".padStart(M,"0"):D(n,M):this.fractionalSecond=n,this.localizedFractionalSecond=V({value:this.fractionalSecond,part:"fractionalSecond",locale:a,numberingSystem:s,hour12:c}),P!==this.fractionalSecond&&this.component.requestUpdate()}else{let P=this[e];this[e]=typeof n=="number"?D(n):n,this[`localized${U(e)}`]=V({value:this[e],part:e,locale:a,numberingSystem:s,hour12:c}),P!==this[e]&&this.component.requestUpdate()}let{hour:f,minute:m,second:p,fractionalSecond:l}=this,d=E({hour:f,minute:m,second:p,fractionalSecond:l},o);u!==d&&(e==="hour"&&t==="12"&&(this.meridiem=B(f),this.localizedMeridiem=W({locale:a,meridiem:this.meridiem})),this.userChangedValue=!0,this.calciteTimeChange.emit(d??""))}},ee=O(T);export{ee as a};
|
|
2
|
+
import{b as g,c as x}from"./YJPIZ6DX.js";import{b as h,f as F,g as $,j as b,k as N}from"./W5QIPFSJ.js";import{a as U}from"./PQYNJXHD.js";import{b as w}from"./YP3AYJH3.js";import{d as O}from"./BKBRE6BE.js";import{p as y,r as H}from"./OD4W6GP7.js";var C=5;function A({locale:r,numberingSystem:e,includeSeconds:n,fractionalSecondDigits:t,hour12:i}){let s={hour:"2-digit",minute:"2-digit",timeZone:"UTC",numberingSystem:$(e)};return typeof i=="boolean"&&(s.hour12=i),n&&(s.second="2-digit",t&&(s.fractionalSecondDigits=t)),N(r,s)}function L(r,e){return parseFloat(`0.${r}`).toFixed(g(e)).replace("0.","")}function D(r,e){if(r==null)return;let n=r.toString(),t=g(r);if(r<1&&t>0&&t<4){let i=n.replace("0.","");return!e||i.length===e?i:i.length<e?i.padEnd(e,"0"):i}if(r>=0&&r<10)return n.padStart(2,"0");if(r>=10)return n}function _(r){return parseInt((parseFloat(`0.${r}`)/.001).toFixed(3),10)}function q(r){let e={locale:r};return r==="mk"?e.hour12=!1:r.toLowerCase()==="es-mx"&&(e.hour12=!0),A(e).formatToParts(new Date(Date.UTC(0,0,0,0,0,0))).find(({type:i})=>i==="dayPeriod")?.value?"12":"24"}function W({locale:r,meridiem:e,parts:n}){let t=["he","bs","mk"],i;if(n){if(i=n.find(({type:s})=>s==="dayPeriod")?.value||null,r&&t.includes(r)){let s=F.get(r);i==="PM"&&(i=s.pm),i==="AM"&&(i=s.am)}}else if(e)if(t.includes(r)){let s=F.get(r);i=e==="PM"?s.pm:s.am}else{let s=A({locale:r,hour12:!0}),o=6,a=18,c=new Date(Date.UTC(0,0,0,e==="AM"?o:a,0));i=s.formatToParts(c).find(({type:f})=>f==="dayPeriod")?.value||null}return i}function k(r,e){return b.numberFormatOptions={locale:r,numberingSystem:e},b.localize("1.1").split("")[1]}function I({hour12:r,locale:e,numberingSystem:n="latn",part:t,step:i}){let o=A({hour12:r,includeSeconds:i<60,locale:e,numberingSystem:n}).formatToParts(new Date(Date.UTC(0,0,0,0,0,0)));return S(`${t}Suffix`,o,e)}function S(r,e,n="en"){if(!r||!e)return null;if(r==="hourSuffix"){let t=e.find(({type:c})=>c==="hour"),i=e.find(({type:c})=>c==="minute"),s=t?e.indexOf(t):-1,o=i?e.indexOf(i):-1,a=e[s+1];return a?.type==="literal"&&o-s===2&&a.value||null}if(r==="minuteSuffix"){let t=e.find(({type:o})=>o==="minute"),i=t?e.indexOf(t):-1,s=e[i+1];return s?.type==="literal"&&s.value||null}if(r==="secondSuffix"){let t,i=e.find(({type:o})=>o==="fractionalSecond"),s=i?e.indexOf(i):-1;if(s!==-1)t=e[s+1];else{let o=e.find(({type:c})=>c==="second"),a=o?e.indexOf(o):-1;t=e[a+1]}return t?.type==="literal"&&t.value||null}return r==="meridiem"&&(e.find(({type:i})=>i==="dayPeriod")?.value||null)?W({locale:n,parts:e})??null:e.find(({type:t})=>t===r)?.value||null}function B(r){if(!h(r))return null;let e=parseInt(r,10);return e>=0&&e<=11?"AM":"PM"}function Z(r){return new Intl.DateTimeFormat(r,{hour:"2-digit",hour12:!0,minute:"2-digit",timeZone:"UTC"}).formatToParts(new Date(Date.UTC(0,0,0,0,0))).findIndex(t=>t.type==="dayPeriod")}function z(r){let e=typeof r=="string";if(!r||e&&(r.startsWith(":")||r.endsWith(":"))||!e&&(!r.hour||!r.minute))return!1;let n,t,i;if(e?[n,t,i]=r.split(":"):{hour:n,minute:t,second:i}=r,!n||!t)return!1;let s=parseInt(n,10),o=parseInt(t,10),a=parseInt(i??"",10),c=h(n)&&s>=0&&s<24,u=h(t)&&o>=0&&o<60,f=h(i)&&a>=0&&a<60;return c&&u&&(!i||f)}function v(r,e){if(e==="meridiem")return r==="AM"||r==="PM";if(!h(r))return!1;let t=Number(r),i=t>=0,s=t<24,o=t<60,a=t<=999;return e==="hour"?i&&s:e==="fractionalSecond"?i&&a:i&&o}function V({value:r,part:e,locale:n,numberingSystem:t="latn",hour12:i}){if(!v(r,e))return;if(e==="fractionalSecond"){let f=k(n,t),m=null;if(r){b.numberFormatOptions={locale:n,numberingSystem:t};let p=b.localize("0");parseInt(r,10)===0?m="".padStart(r.length,p):(m=b.localize(`0.${r}`).replace(`${p}${f}`,""),m.length<r.length&&(m=m.padEnd(r.length,p)))}return m}let s=parseInt(r,10),o=new Date(Date.UTC(0,0,0,e==="hour"?s:e==="meridiem"?r==="AM"?0:12:0,e==="minute"?s:0,e==="second"?s:0));if(!o)return;let a=["second","fractionalSecond"].includes(e),u=A({hour12:i,includeSeconds:a,locale:n,numberingSystem:t}).formatToParts(o);return S(e,u,n)}function G({hour12:r,locale:e,numberingSystem:n="latn",parts:t=!1,step:i,value:s}){if(!z(s))return null;let{hour:o,minute:a,second:c="0",fractionalSecond:u}=K(s,i),f=i<60,m=new Date(Date.UTC(0,0,0,parseInt(o,10),parseInt(a,10),f&&typeof c=="string"?parseInt(c,10):0,f&&u?_(u):0)),p=A({fractionalSecondDigits:g(i),hour12:r,includeSeconds:f,locale:e,numberingSystem:n});if(t){let l=p.formatToParts(m);return{hour:S("hour",l),hourSuffix:S("hourSuffix",l),minute:S("minute",l),minuteSuffix:S("minuteSuffix",l),second:S("second",l),decimalSeparator:k(e,n),fractionalSecond:S("fractionalSecond",l),secondSuffix:e!=="bg"?S("secondSuffix",l):null,meridiem:S("meridiem",l,e)}}else{let l=p.format(m)||null;if(!t&&typeof l=="string"&&e==="bg"&&l&&l.includes(" \u0447.")&&(l=l.replaceAll(" \u0447.","")),["he","bs","mk"].includes(e)){let d=F.get(e);l.includes("AM")?l=l.replaceAll("AM",d.am):l.includes("PM")&&(l=l.replaceAll("PM",d.pm)),e!=="he"&&l.indexOf(".")!==l.length-1&&(l=l.replace(".",","))}return l}}function K(r,e){if(z(r)){let[n,t,i]=r.split(":"),s=i,o=null;return i?.includes(".")&&([s,o]=i.split(".")),e&&typeof o=="string"&&(o=L(o,e)),{fractionalSecond:o,hour:n,minute:t,second:s}}return{fractionalSecond:null,hour:null,minute:null,second:null}}function E(r,e=60){if(!z(r))return null;let n,t,i,s,o,a=null;return typeof r=="string"?([n,t,s]=r.split(":"),[i,o]=s?.split(".")||["0"]):(n=r.hour,t=r.minute,i=r.second,o=r.fractionalSecond),n&&t&&(a=`${D(parseInt(n,10))}:${D(parseInt(t,10))}`,e<60&&(a+=`:${D(parseInt(i||"0",10))}`,e<1&&(a+=`.${L(o||"0",e)}`))),a}var T=class extends H{constructor(){super(...arguments),this.localizedDecimalSeparator=".",this.userChangedValue=!1,this.handleHourKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(h(this.hour))switch(this.hourFormat){case"12":i=this.hour==="01"&&t>=0&&t<=2?`1${t}`:t;break;case"24":this.hour==="01"?i=`1${t}`:this.hour==="02"&&t>=0&&t<=3?i=`2${t}`:i=t;break}else i=t;this.setValuePart("hour",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("hour",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementHour();break;case"ArrowUp":e.preventDefault(),this.incrementHour();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleMinuteKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(typeof this.minute=="string"&&h(this.minute)&&this.minute.startsWith("0")){let s=parseInt(this.minute,10);i=s>C?t:`${s}${t}`}else i=t;this.setValuePart("minute",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("minute",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementMinute();break;case"ArrowUp":e.preventDefault(),this.incrementMinute();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleSecondKeyDownEvent=e=>{let n=e.key;if(w.includes(n)){let t=parseInt(n,10),i;if(typeof this.second=="string"&&h(this.second)&&this.second.startsWith("0")){let s=parseInt(this.second,10);i=s>C?t:`${s}${t}`}else i=t;this.setValuePart("second",i)}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("second",void 0);break;case"ArrowDown":e.preventDefault(),this.decrementSecond();break;case"ArrowUp":e.preventDefault(),this.incrementSecond();break;case" ":case"Spacebar":e.preventDefault();break}},this.handleFractionalSecondKeyDownEvent=e=>{let{key:n}=e;if(w.includes(n)){let t=g(this.component.step),i=parseInt(this.fractionalSecond,10),s=i.toString().length,o;s>=t?o=n.padStart(t,"0"):s<t&&(o=`${i}${n}`.padStart(t,"0")),this.setValuePart("fractionalSecond",parseFloat(`0.${o}`))}else switch(n){case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("fractionalSecond",void 0);break;case"ArrowDown":e.preventDefault(),this.nudgeFractionalSecond("down");break;case"ArrowUp":e.preventDefault(),this.nudgeFractionalSecond("up");break;case" ":e.preventDefault();break}},this.handleMeridiemKeyDownEvent=e=>{switch(e.key){case"a":this.setValuePart("meridiem","AM");break;case"p":this.setValuePart("meridiem","PM");break;case"Backspace":case"Delete":e.preventDefault(),this.setValuePart("meridiem");break;case"ArrowUp":e.preventDefault(),this.toggleMeridiem("up");break;case"ArrowDown":e.preventDefault(),this.toggleMeridiem("down");break;case" ":case"Spacebar":e.preventDefault();break}},this.calciteTimeChange=y()}get hasValue(){return!!(this?.hour||this?.minute||this?.second||this?.fractionalSecond||this?.meridiem)}decrementHour(){let e=this.hour?this.hour==="00"?23:parseInt(this.hour,10)-1:0;this.setValuePart("hour",e)}decrementMinute(){this.decrementMinuteOrSecond("minute")}decrementSecond(){this.decrementMinuteOrSecond("second")}incrementHour(){let e=typeof this.hour=="string"&&h(this.hour)?this.hour==="23"?0:parseInt(this.hour,10)+1:1;this.setValuePart("hour",e)}incrementMinute(){this.incrementMinuteOrSecond("minute")}incrementSecond(){this.incrementMinuteOrSecond("second")}nudgeFractionalSecond(e){let n=x(this.component.step),t=g(this.component.step),i=parseInt(this.fractionalSecond,10),s=parseFloat(`0.${this.fractionalSecond}`),o,a,c,u;e==="up"&&(o=isNaN(i)?0:s+n,a=parseFloat(o.toFixed(t)),c=x(a),u=a<1&&g(c)>0?D(c,t):"".padStart(t,"0")),e==="down"&&(o=isNaN(i)||i===0?1-n:s-n,a=parseFloat(o.toFixed(t)),c=x(a),u=a<1&&g(c)>0&&Math.sign(c)===1?D(c,t):"".padStart(t,"0")),this.setValuePart("fractionalSecond",u)}toggleMeridiem(e){let n;this.meridiem?n=this.meridiem==="AM"?"PM":"AM":n=e==="down"?"PM":"AM",this.setValuePart("meridiem",n)}hostConnected(){this.setHourFormat(),this.setMeridiemOrder(),this.setValue(this.component.value)}hostUpdate(e){let n=!1,t=!1,i=!1;if(e.has("hourFormat")&&(n=!0,i=!0),e.has("messages")&&e.get("messages")?._lang!==this.component.messages._lang&&(n=!0,t=!0,i=!0),e.has("numberingSystem")&&(i=!0),e.has("step")){let s=this.component.step,o=e.get("step");(s>=60&&o>0&&o<60||o>=60&&s>0&&s<60)&&(i=!0)}n&&this.setHourFormat(),t&&this.setMeridiemOrder(),i&&this.setValue(this.component.value),this.userChangedValue=!1}decrementMinuteOrSecond(e){let n;if(h(this[e])){let t=parseInt(this[e],10);n=t===0?59:t-1}else n=59;this.setValuePart(e,n)}incrementMinuteOrSecond(e){let n=h(this[e])?this[e]==="59"?0:parseInt(this[e],10)+1:0;this.setValuePart(e,n)}setHourFormat(){let{hourFormat:e,messages:n}=this.component;this.hourFormat=e==="user"?q(n._lang):e}setMeridiemOrder(){let{messages:e}=this.component;this.meridiemOrder=Z(e._lang)}setValue(e,n=!1){let{messages:t,numberingSystem:i,step:s,value:o}=this.component,a=t._lang,c=this.hourFormat==="12",u=E(e,s);if(z(e)){let{hour:f,minute:m,second:p,fractionalSecond:l}=K(u,s),d=G({hour12:c,locale:a,numberingSystem:i,parts:!0,step:s,value:u});this.hour=f,this.minute=m,this.second=p,this.fractionalSecond=l,d&&(this.localizedHour=d.hour,this.localizedHourSuffix=d.hourSuffix,this.localizedMinute=d.minute,this.localizedMinuteSuffix=d.minuteSuffix,this.localizedSecond=d.second,this.localizedDecimalSeparator=d.decimalSeparator,this.localizedFractionalSecond=d.fractionalSecond,this.localizedSecondSuffix=d.secondSuffix,d.meridiem&&(this.meridiem=B(this.hour),this.localizedMeridiem=d.meridiem))}else this.hour=null,this.minute=null,this.second=null,this.fractionalSecond=null,this.meridiem=null,this.localizedHour=null,this.localizedHourSuffix=I({hour12:c,part:"hour",locale:a,numberingSystem:i,step:s}),this.localizedMinute=null,this.localizedMinuteSuffix=I({hour12:c,part:"minute",locale:a,numberingSystem:i,step:s}),this.localizedSecond=null,this.localizedDecimalSeparator=k(a,i),this.localizedFractionalSecond=null,this.localizedSecondSuffix=I({hour12:c,part:"second",locale:a,numberingSystem:i,step:s}),this.localizedMeridiem=null;u!==o?(this.userChangedValue=n,this.component.value=u??""):this.component.requestUpdate()}setValuePart(e,n){let{hourFormat:t}=this,{messages:i,numberingSystem:s,step:o}=this.component,a=i._lang,c=t==="12",u=this.component.value;if(e==="meridiem"){let P=this.meridiem;if(this.meridiem=n,this.localizedMeridiem=V({hour12:c,locale:a,numberingSystem:s,part:"meridiem",value:this.meridiem}),h(this.hour)){let M=parseInt(this.hour,10);switch(n){case"AM":M>=12&&(this.hour=D(M-12));break;case"PM":M<12&&(this.hour=D(M+12));break;default:this.userChangedValue=!0,this.component.value="";break}this.localizedHour=V({hour12:c,locale:a,numberingSystem:s,part:"hour",value:this.hour})}P!==this.meridiem&&this.component.requestUpdate()}else if(e==="fractionalSecond"){let P=this.fractionalSecond,M=g(o);typeof n=="number"?this.fractionalSecond=n===0?"".padStart(M,"0"):D(n,M):this.fractionalSecond=n,this.localizedFractionalSecond=V({value:this.fractionalSecond,part:"fractionalSecond",locale:a,numberingSystem:s,hour12:c}),P!==this.fractionalSecond&&this.component.requestUpdate()}else{let P=this[e];this[e]=typeof n=="number"?D(n):n,this[`localized${U(e)}`]=V({value:this[e],part:e,locale:a,numberingSystem:s,hour12:c}),P!==this[e]&&this.component.requestUpdate()}let{hour:f,minute:m,second:p,fractionalSecond:l}=this,d=E({hour:f,minute:m,second:p,fractionalSecond:l},o);u!==d&&(e==="hour"&&t==="12"&&(this.meridiem=B(f),this.localizedMeridiem=W({locale:a,meridiem:this.meridiem})),this.userChangedValue=!0,this.calciteTimeChange.emit(d??""))}},ee=O(T);export{ee as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as de}from"./ZGO66DGC.js";function He(e,t,n){return(t=We(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$.apply(null,arguments)}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?he(Object(n),!0).forEach(function(o){He(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function je(e,t){if(e==null)return{};var n,o,i=Ke(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ke(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Le(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function We(e){var t=Le(e,"string");return typeof t=="symbol"?t:t+""}function Jt(e){"@babel/helpers - typeof";return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(e)}var ze="1.15.7";function U(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var q=U(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Tt=U(/Edge/i),pe=U(/firefox/i),Et=U(/safari/i)&&!U(/chrome/i)&&!U(/android/i),ie=U(/iP(ad|od|hone)/i),De=U(/chrome/i)&&U(/android/i),Se={capture:!1,passive:!1};function v(e,t,n){e.addEventListener(t,n,!q&&Se)}function m(e,t,n){e.removeEventListener(t,n,!q&&Se)}function Xt(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function _e(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function H(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Xt(e,t):Xt(e,t))||o&&e===n)return e;if(e===n)break}while(e=_e(e))}return null}var ge=/\s+/g;function R(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(ge," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(ge," ")}}function h(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function ft(e,t){var n="";if(typeof e=="string")n=e;else do{var o=h(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ce(e,t,n){if(e){var o=e.getElementsByTagName(t),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function K(){var e=document.scrollingElement;return e||document.documentElement}function T(e,t,n,o,i){if(!(!e.getBoundingClientRect&&e!==window)){var r,a,l,s,u,d,f;if(e!==window&&e.parentNode&&e!==K()?(r=e.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,u=r.right,d=r.height,f=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!q))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||n&&h(i,"position")!=="static")){var b=i.getBoundingClientRect();a-=b.top+parseInt(h(i,"border-top-width")),l-=b.left+parseInt(h(i,"border-left-width")),s=a+r.height,u=l+r.width;break}while(i=i.parentNode);if(o&&e!==window){var E=ft(i||e),y=E&&E.a,w=E&&E.d;E&&(a/=w,l/=y,f/=y,d/=w,s=a+d,u=l+f)}return{top:a,left:l,bottom:s,right:u,width:f,height:d}}}function me(e,t,n){for(var o=tt(e,!0),i=T(e)[t];o;){var r=T(o)[n],a=void 0;if(n==="top"||n==="left"?a=i>=r:a=i<=r,!a)return o;if(o===K())break;o=tt(o,!1)}return!1}function dt(e,t,n,o){for(var i=0,r=0,a=e.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==p.ghost&&(o||a[r]!==p.dragged)&&H(a[r],n.draggable,e,!1)){if(i===t)return a[r];i++}r++}return null}function re(e,t){for(var n=e.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||t&&!Xt(n,t));)n=n.previousElementSibling;return n||null}function G(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==p.clone&&(!t||Xt(e,t))&&n++;return n}function ve(e){var t=0,n=0,o=K();if(e)do{var i=ft(e),r=i.a,a=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*a}while(e!==o&&(e=e.parentNode));return[t,n]}function Ue(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function tt(e,t){if(!e||!e.getBoundingClientRect)return K();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=h(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return K();if(o||t)return n;o=!0}}while(n=n.parentNode);return K()}function $e(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Lt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Dt;function Te(e,t){return function(){if(!Dt){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Dt=setTimeout(function(){Dt=void 0},t)}}}function qe(){clearTimeout(Dt),Dt=void 0}function Oe(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ae(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Ie(e,t,n){var o={};return Array.from(e.children).forEach(function(i){var r,a,l,s;if(!(!H(i,t.draggable,e,!1)||i.animated||i===n)){var u=T(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,u.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,u.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,u.right),o.bottom=Math.max((s=o.bottom)!==null&&s!==void 0?s:-1/0,u.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var N="Sortable"+new Date().getTime();function Ve(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(h(i,"display")==="none"||i===p.ghost)){e.push({target:i,rect:T(i)});var r=L({},e[e.length-1].rect);if(i.thisAnimationDuration){var a=ft(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(Ue(e,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,a=0;e.forEach(function(l){var s=0,u=l.target,d=u.fromRect,f=T(u),b=u.prevFromRect,E=u.prevToRect,y=l.rect,w=ft(u,!0);w&&(f.top-=w.f,f.left-=w.e),u.toRect=f,u.thisAnimationDuration&&Lt(b,f)&&!Lt(d,f)&&(y.top-f.top)/(y.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(s=Qe(y,b,E,i.options)),Lt(f,d)||(u.prevFromRect=d,u.prevToRect=f,s||(s=i.options.animation),i.animate(u,y,f,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),e=[]},animate:function(o,i,r,a){if(a){h(o,"transition",""),h(o,"transform","");var l=ft(this.el),s=l&&l.a,u=l&&l.d,d=(i.left-r.left)/(s||1),f=(i.top-r.top)/(u||1);o.animatingX=!!d,o.animatingY=!!f,h(o,"transform","translate3d("+d+"px,"+f+"px,0)"),this.forRepaintDummy=Ze(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Ze(e){return e.offsetWidth}function Qe(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var lt=[],Wt={initializeByDefault:!0},Ot={mount:function(t){for(var n in Wt)Wt.hasOwnProperty(n)&&!(n in t)&&(t[n]=Wt[n]);lt.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),lt.push(t)},pluginEvent:function(t,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=t+"Global";lt.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](L({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][t]&&n[a.pluginName][t](L({sortable:n},o)))})},initializePlugins:function(t,n,o,i){lt.forEach(function(l){var s=l.pluginName;if(!(!t.options[s]&&!l.initializeByDefault)){var u=new l(t,n,t.options);u.sortable=t,u.options=t.options,t[s]=u,$(o,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,n){var o={};return lt.forEach(function(i){typeof i.eventProperties=="function"&&$(o,i.eventProperties.call(n[i.pluginName],t))}),o},modifyOption:function(t,n,o){var i;return lt.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(t[r.pluginName],o))}),i}};function Je(e){var t=e.sortable,n=e.rootEl,o=e.name,i=e.targetEl,r=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,d=e.oldDraggableIndex,f=e.newDraggableIndex,b=e.originalEvent,E=e.putSortable,y=e.extraEventProperties;if(t=t||n&&n[N],!!t){var w,X=t.options,W="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!q&&!Tt?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=l||n,w.item=i||n,w.clone=r,w.oldIndex=s,w.newIndex=u,w.oldDraggableIndex=d,w.newDraggableIndex=f,w.originalEvent=b,w.pullMode=E?E.lastPutMode:void 0;var I=L(L({},y),Ot.getEventProperties(o,t));for(var Y in I)w[Y]=I[Y];n&&n.dispatchEvent(w),X[W]&&X[W].call(t,w)}}var tn=["evt"],P=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=je(o,tn);Ot.pluginEvent.bind(p)(t,n,L({dragEl:c,parentEl:_,ghostEl:g,rootEl:D,nextEl:at,lastDownEl:Ft,cloneEl:S,cloneHidden:J,dragStarted:bt,putSortable:O,activeSortable:p.active,originalEvent:i,oldIndex:ct,oldDraggableIndex:St,newIndex:k,newDraggableIndex:Q,hideGhostForTarget:Me,unhideGhostForTarget:Fe,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(l){x({sortable:n,name:l,originalEvent:i})}},r))};function x(e){Je(L({putSortable:O,cloneEl:S,targetEl:c,rootEl:D,oldIndex:ct,oldDraggableIndex:St,newIndex:k,newDraggableIndex:Q},e))}var c,_,g,D,at,Ft,S,J,ct,k,St,Q,xt,O,ut=!1,Yt=!1,Bt=[],it,B,zt,Ut,be,ye,bt,st,_t,Ct=!1,Pt=!1,Rt,A,$t=[],te=!1,Ht=[],Kt=typeof document<"u",Nt=ie,we=Tt||q?"cssFloat":"float",en=Kt&&!De&&!ie&&"draggable"in document.createElement("div"),xe=(function(){if(Kt){if(q)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Pe=function(t,n){var o=h(t),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=dt(t,0,n),a=dt(t,1,n),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+T(r).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&o[we]==="none"||a&&o[we]==="none"&&u+d>i)?"vertical":"horizontal"},nn=function(t,n,o){var i=o?t.left:t.top,r=o?t.right:t.bottom,a=o?t.width:t.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return i===l||r===s||i+a/2===l+u/2},on=function(t,n){var o;return Bt.some(function(i){var r=i[N].options.emptyInsertThreshold;if(!(!r||re(i))){var a=T(i),l=t>=a.left-r&&t<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(l&&s)return o=i}}),o},Ne=function(t){function n(r,a){return function(l,s,u,d){var f=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,s,u,d),a)(l,s,u,d);var b=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===b||r.join&&r.indexOf(b)>-1}}var o={},i=t.group;(!i||Jt(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,t.group=o},Me=function(){!xe&&g&&h(g,"display","none")},Fe=function(){!xe&&g&&h(g,"display","")};Kt&&!De&&document.addEventListener("click",function(e){if(Yt)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Yt=!1,!1},!0);var rt=function(t){if(c){t=t.touches?t.touches[0]:t;var n=on(t.clientX,t.clientY);if(n){var o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[N]._onDragOver(o)}}},rn=function(t){c&&c.parentNode[N]._isOutsideThisEl(t.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$({},t),e[N]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&(!Et||ie),emptyInsertThreshold:5};Ot.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);Ne(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:en,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?v(e,"pointerdown",this._onTapStart):(v(e,"mousedown",this._onTapStart),v(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(e,"dragover",this),v(e,"dragenter",this)),Bt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$(this,Ve())}p.prototype={constructor:p,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(st=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,c):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(l||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,d=i.filter;if(hn(o),!c&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Et&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=H(s,i.draggable,o,!1),!(s&&s.animated)&&Ft!==s)){if(ct=G(s),St=G(s,i.draggable),typeof d=="function"){if(d.call(this,t,s,this)){x({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),P("filter",n,{evt:t}),r&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=H(u,f.trim(),o,!1),f)return x({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:o,toEl:o}),P("filter",n,{evt:t}),!0}),d)){r&&t.preventDefault();return}i.handle&&!H(u,i.handle,o,!1)||this._prepareDragStart(t,l,s)}}},_prepareDragStart:function(t,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(o&&!c&&o.parentNode===r){var u=T(o);if(D=r,c=o,_=c.parentNode,at=c.nextSibling,Ft=o,xt=a.group,p.dragged=c,it={target:c,clientX:(n||t).clientX,clientY:(n||t).clientY},be=it.clientX-u.left,ye=it.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,c.style["will-change"]="all",s=function(){if(P("delayEnded",i,{evt:t}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!pe&&i.nativeDraggable&&(c.draggable=!0),i._triggerDragStart(t,n),x({sortable:i,name:"choose",originalEvent:t}),R(c,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Ce(c,d.trim(),qt)}),v(l,"dragover",rt),v(l,"mousemove",rt),v(l,"touchmove",rt),a.supportPointer?(v(l,"pointerup",i._onDrop),!this.nativeDraggable&&v(l,"pointercancel",i._onDrop)):(v(l,"mouseup",i._onDrop),v(l,"touchend",i._onDrop),v(l,"touchcancel",i._onDrop)),pe&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),P("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Tt||q))){if(p.eventCanceled){this._onDrop();return}a.supportPointer?(v(l,"pointerup",i._disableDelayedDrag),v(l,"pointercancel",i._disableDelayedDrag)):(v(l,"mouseup",i._disableDelayedDrag),v(l,"touchend",i._disableDelayedDrag),v(l,"touchcancel",i._disableDelayedDrag)),v(l,"mousemove",i._delayedDragTouchMoveHandler),v(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&v(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){c&&qt(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):n?v(document,"touchmove",this._onTouchMove):v(document,"mousemove",this._onTouchMove):(v(c,"dragend",this),v(D,"dragstart",this._onDragStart));try{document.selection?kt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ut=!1,D&&c){P("dragStarted",this,{evt:n}),this.nativeDraggable&&v(document,"dragover",rn);var o=this.options;!t&&R(c,o.dragClass,!1),R(c,o.ghostClass,!0),p.active=this,t&&this._appendGhost(),x({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(B){this._lastX=B.clientX,this._lastY=B.clientY,Me();for(var t=document.elementFromPoint(B.clientX,B.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(B.clientX,B.clientY),t!==n);)n=t;if(c.parentNode[N]._isOutsideThisEl(t),n)do{if(n[N]){var o=void 0;if(o=n[N]._onDragOver({clientX:B.clientX,clientY:B.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=_e(n));Fe()}},_onTouchMove:function(t){if(it){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=t.touches?t.touches[0]:t,a=g&&ft(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Nt&&A&&ve(A),d=(r.clientX-it.clientX+i.x)/(l||1)+(u?u[0]-$t[0]:0)/(l||1),f=(r.clientY-it.clientY+i.y)/(s||1)+(u?u[1]-$t[1]:0)/(s||1);if(!p.active&&!ut){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(g){a?(a.e+=d-(zt||0),a.f+=f-(Ut||0)):a={a:1,b:0,c:0,d:1,e:d,f};var b="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(g,"webkitTransform",b),h(g,"mozTransform",b),h(g,"msTransform",b),h(g,"transform",b),zt=d,Ut=f,B=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!g){var t=this.options.fallbackOnBody?document.body:D,n=T(c,!0,Nt,!0,t),o=this.options;if(Nt){for(A=t;h(A,"position")==="static"&&h(A,"transform")==="none"&&A!==document;)A=A.parentNode;A!==document.body&&A!==document.documentElement?(A===document&&(A=K()),n.top+=A.scrollTop,n.left+=A.scrollLeft):A=K(),$t=ve(A)}g=c.cloneNode(!0),R(g,o.ghostClass,!1),R(g,o.fallbackClass,!0),R(g,o.dragClass,!0),h(g,"transition",""),h(g,"transform",""),h(g,"box-sizing","border-box"),h(g,"margin",0),h(g,"top",n.top),h(g,"left",n.left),h(g,"width",n.width),h(g,"height",n.height),h(g,"opacity","0.8"),h(g,"position",Nt?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,t.appendChild(g),h(g,"transform-origin",be/parseInt(g.style.width)*100+"% "+ye/parseInt(g.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,i=t.dataTransfer,r=o.options;if(P("dragStart",this,{evt:t}),p.eventCanceled){this._onDrop();return}P("setupClone",this),p.eventCanceled||(S=Ae(c),S.removeAttribute("id"),S.draggable=!1,S.style["will-change"]="",this._hideClone(),R(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=kt(function(){P("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||D.insertBefore(S,c),o._hideClone(),x({sortable:o,name:"clone"}))}),!n&&R(c,r.dragClass,!0),n?(Yt=!0,o._loopId=setInterval(o._emulateDragOver,50)):(m(document,"mouseup",o._onDrop),m(document,"touchend",o._onDrop),m(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,c)),v(document,"drop",o),h(c,"transform","translateZ(0)")),ut=!0,o._dragStartId=kt(o._dragStarted.bind(o,n,t)),v(document,"selectstart",o),bt=!0,window.getSelection().removeAllRanges(),Et&&h(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,i,r,a,l=this.options,s=l.group,u=p.active,d=xt===s,f=l.sort,b=O||u,E,y=this,w=!1;if(te)return;function X(vt,Ye){P(vt,y,L({evt:t,isOwner:d,axis:E?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:b,target:o,completed:I,onMove:function(fe,Be){return Mt(D,n,c,i,fe,T(fe),t,Be)},changed:Y},Ye))}function W(){X("dragOverAnimationCapture"),y.captureAnimationState(),y!==b&&b.captureAnimationState()}function I(vt){return X("dragOverCompleted",{insertion:vt}),vt&&(d?u._hideClone():u._showClone(y),y!==b&&(R(c,O?O.options.ghostClass:u.options.ghostClass,!1),R(c,l.ghostClass,!0)),O!==y&&y!==p.active?O=y:y===p.active&&O&&(O=null),b===y&&(y._ignoreWhileAnimating=o),y.animateAll(function(){X("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===c&&!c.animated||o===n&&!o.animated)&&(st=null),!l.dragoverBubble&&!t.rootEl&&o!==document&&(c.parentNode[N]._isOutsideThisEl(t.target),!vt&&rt(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),w=!0}function Y(){k=G(c),Q=G(c,l.draggable),x({sortable:y,name:"change",toEl:n,newIndex:k,newDraggableIndex:Q,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=H(o,l.draggable,n,!0),X("dragOver"),p.eventCanceled)return w;if(c.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||y._ignoreWhileAnimating===o)return I(!1);if(Yt=!1,u&&!l.disabled&&(d?f||(a=_!==D):O===this||(this.lastPutMode=xt.checkPull(this,u,c,t))&&s.checkPut(this,u,c,t))){if(E=this._getDirection(t,o)==="vertical",i=T(c),X("dragOverValid"),p.eventCanceled)return w;if(a)return _=D,W(),this._hideClone(),X("revert"),p.eventCanceled||(at?D.insertBefore(c,at):D.appendChild(c)),I(!0);var M=re(n,l.draggable);if(!M||un(t,E,this)&&!M.animated){if(M===c)return I(!1);if(M&&n===t.target&&(o=M),o&&(r=T(o)),Mt(D,n,c,i,o,r,t,!!o)!==!1)return W(),M&&M.nextSibling?n.insertBefore(c,M.nextSibling):n.appendChild(c),_=n,Y(),I(!0)}else if(M&&sn(t,E,this)){var et=dt(n,0,l,!0);if(et===c)return I(!1);if(o=et,r=T(o),Mt(D,n,c,i,o,r,t,!1)!==!1)return W(),n.insertBefore(c,et),_=n,Y(),I(!0)}else if(o.parentNode===n){r=T(o);var j=0,nt,ht=c.parentNode!==n,F=!nn(c.animated&&c.toRect||i,o.animated&&o.toRect||r,E),pt=E?"top":"left",V=me(o,"top","top")||me(c,"top","top"),gt=V?V.scrollTop:void 0;st!==o&&(nt=r[pt],Ct=!1,Pt=!F&&l.invertSwap||ht),j=cn(t,o,r,E,F?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Pt,st===o);var z;if(j!==0){var ot=G(c);do ot-=j,z=_.children[ot];while(z&&(h(z,"display")==="none"||z===g))}if(j===0||z===o)return I(!1);st=o,_t=j;var mt=o.nextElementSibling,Z=!1;Z=j===1;var It=Mt(D,n,c,i,o,r,t,Z);if(It!==!1)return(It===1||It===-1)&&(Z=It===1),te=!0,setTimeout(ln,30),W(),Z&&!mt?n.appendChild(c):o.parentNode.insertBefore(c,Z?mt:o),V&&Oe(V,0,gt-V.scrollTop),_=c.parentNode,nt!==void 0&&!Pt&&(Rt=Math.abs(nt-T(o)[pt])),Y(),I(!0)}if(n.contains(c))return I(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",rt),m(document,"mousemove",rt),m(document,"touchmove",rt)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(k=G(c),Q=G(c,o.draggable),P("drop",this,{evt:t}),_=c&&c.parentNode,k=G(c),Q=G(c,o.draggable),p.eventCanceled){this._nulling();return}ut=!1,Pt=!1,Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ee(this.cloneId),ee(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Et&&h(document.body,"user-select",""),h(c,"transform",""),t&&(bt&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(D===_||O&&O.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),c&&(this.nativeDraggable&&m(c,"dragend",this),qt(c),c.style["will-change"]="",bt&&!ut&&R(c,O?O.options.ghostClass:this.options.ghostClass,!1),R(c,this.options.chosenClass,!1),x({sortable:this,name:"unchoose",toEl:_,newIndex:null,newDraggableIndex:null,originalEvent:t}),D!==_?(k>=0&&(x({rootEl:_,name:"add",toEl:_,fromEl:D,originalEvent:t}),x({sortable:this,name:"remove",toEl:_,originalEvent:t}),x({rootEl:_,name:"sort",toEl:_,fromEl:D,originalEvent:t}),x({sortable:this,name:"sort",toEl:_,originalEvent:t})),O&&O.save()):k!==ct&&k>=0&&(x({sortable:this,name:"update",toEl:_,originalEvent:t}),x({sortable:this,name:"sort",toEl:_,originalEvent:t})),p.active&&((k==null||k===-1)&&(k=ct,Q=St),x({sortable:this,name:"end",toEl:_,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){P("nulling",this),D=c=_=g=at=S=Ft=J=it=B=bt=k=Q=ct=St=st=_t=O=xt=p.dragged=p.ghost=p.clone=p.active=null;var t=this.el;Ht.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Ht.length=zt=Ut=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":c&&(this._onDragOver(t),an(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],H(n,a.draggable,this.el,!1)&&t.push(n.getAttribute(a.dataIdAttr)||dn(n));return t},sort:function(t,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];H(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return H(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var i=Ot.modifyOption(this,t,n);typeof i<"u"?o[t]=i:o[t]=n,t==="group"&&Ne(o)},destroy:function(){P("destroy",this);var t=this.el;t[N]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Bt.splice(Bt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!J){if(P("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),J=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(J){if(P("showClone",this),p.eventCanceled)return;c.parentNode==D&&!this.options.group.revertClone?D.insertBefore(S,c):at?D.insertBefore(S,at):D.appendChild(S),this.options.group.revertClone&&this.animate(c,S),h(S,"display",""),J=!1}}};function an(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Mt(e,t,n,o,i,r,a,l){var s,u=e[N],d=u.options.onMove,f;return window.CustomEvent&&!q&&!Tt?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=t,s.from=e,s.dragged=n,s.draggedRect=o,s.related=i||t,s.relatedRect=r||T(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),d&&(f=d.call(u,s,a)),f}function qt(e){e.draggable=!1}function ln(){te=!1}function sn(e,t,n){var o=T(dt(n.el,0,n.options,!0)),i=Ie(n.el,n.options,g),r=10;return t?e.clientX<i.left-r||e.clientY<o.top&&e.clientX<o.right:e.clientY<i.top-r||e.clientY<o.bottom&&e.clientX<o.left}function un(e,t,n){var o=T(re(n.el,n.options.draggable)),i=Ie(n.el,n.options,g),r=10;return t?e.clientX>i.right+r||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>i.bottom+r||e.clientX>o.right&&e.clientY>o.top}function cn(e,t,n,o,i,r,a,l){var s=o?e.clientY:e.clientX,u=o?n.height:n.width,d=o?n.top:n.left,f=o?n.bottom:n.right,b=!1;if(!a){if(l&&Rt<u*i){if(!Ct&&(_t===1?s>d+u*r/2:s<f-u*r/2)&&(Ct=!0),Ct)b=!0;else if(_t===1?s<d+Rt:s>f-Rt)return-_t}else if(s>d+u*(1-i)/2&&s<f-u*(1-i)/2)return fn(t)}return b=b||a,b&&(s<d+u*r/2||s>f-u*r/2)?s>d+u/2?1:-1:0}function fn(e){return G(c)<G(e)?1:-1}function dn(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function hn(e){Ht.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Ht.push(o)}}function kt(e){return setTimeout(e,0)}function ee(e){return clearTimeout(e)}Kt&&v(document,"touchmove",function(e){(p.active||ut)&&e.cancelable&&e.preventDefault()});p.utils={on:v,off:m,css:h,find:Ce,is:function(t,n){return!!H(t,n,t,!1)},extend:$e,throttle:Te,closest:H,toggleClass:R,clone:Ae,index:G,nextTick:kt,cancelNextTick:ee,detectDirection:Pe,getChild:dt,expando:N};p.get=function(e){return e[N]};p.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=L(L({},p.utils),o.utils)),Ot.mount(o)})};p.create=function(e,t){return new p(e,t)};p.version=ze;var C=[],yt,ne,oe=!1,Vt,Zt,jt,wt;function pn(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):o.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),Ee(),Gt(),qe()},nulling:function(){jt=ne=yt=oe=wt=Vt=Zt=null,C.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(jt=n,o||this.options.forceAutoScrollFallback||Tt||q||Et){Qt(n,this.options,l,o);var s=tt(l,!0);oe&&(!wt||r!==Vt||a!==Zt)&&(wt&&Ee(),wt=setInterval(function(){var u=tt(document.elementFromPoint(r,a),!0);u!==s&&(s=u,Gt()),Qt(n,i.options,u,o)},10),Vt=r,Zt=a)}else{if(!this.options.bubbleScroll||tt(l,!0)===K()){Gt();return}Qt(n,this.options,tt(l,!1),!1)}}},$(e,{pluginName:"scroll",initializeByDefault:!0})}function Gt(){C.forEach(function(e){clearInterval(e.pid)}),C=[]}function Ee(){clearInterval(wt)}var Qt=Te(function(e,t,n,o){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,s=K(),u=!1,d;ne!==n&&(ne=n,Gt(),yt=t.scroll,d=t.scrollFn,yt===!0&&(yt=tt(n,!0)));var f=0,b=yt;do{var E=b,y=T(E),w=y.top,X=y.bottom,W=y.left,I=y.right,Y=y.width,M=y.height,et=void 0,j=void 0,nt=E.scrollWidth,ht=E.scrollHeight,F=h(E),pt=E.scrollLeft,V=E.scrollTop;E===s?(et=Y<nt&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),j=M<ht&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(et=Y<nt&&(F.overflowX==="auto"||F.overflowX==="scroll"),j=M<ht&&(F.overflowY==="auto"||F.overflowY==="scroll"));var gt=et&&(Math.abs(I-i)<=a&&pt+Y<nt)-(Math.abs(W-i)<=a&&!!pt),z=j&&(Math.abs(X-r)<=a&&V+M<ht)-(Math.abs(w-r)<=a&&!!V);if(!C[f])for(var ot=0;ot<=f;ot++)C[ot]||(C[ot]={});(C[f].vx!=gt||C[f].vy!=z||C[f].el!==E)&&(C[f].el=E,C[f].vx=gt,C[f].vy=z,clearInterval(C[f].pid),(gt!=0||z!=0)&&(u=!0,C[f].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove(jt);var mt=C[this.layer].vy?C[this.layer].vy*l:0,Z=C[this.layer].vx?C[this.layer].vx*l:0;typeof d=="function"&&d.call(p.dragged.parentNode[N],Z,mt,e,jt,C[this.layer].el)!=="continue"||Oe(C[this.layer].el,Z,mt)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&b!==s&&(b=tt(b,!1)));oe=u}},30),Re=function(t){var n=t.originalEvent,o=t.putSortable,i=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,l=t.hideGhostForTarget,s=t.unhideGhostForTarget;if(n){var u=o||r;l();var d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(d.clientX,d.clientY);s(),u&&!u.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function ae(){}ae.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=dt(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Re};$(ae,{pluginName:"revertOnSpill"});function le(){}le.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,i=o||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:Re};$(le,{pluginName:"removeOnSpill"});p.mount(new pn);p.mount(le,ae);var ke=p;var At=new Set,gn={ghostClass:"calcite-sortable--ghost",chosenClass:"calcite-sortable--chosen",dragClass:"calcite-sortable--drag",fallbackClass:"calcite-sortable--fallback"};function mn(){Array.from(At).forEach(e=>e.onGlobalDragStart())}function vn(){Array.from(At).forEach(e=>e.onGlobalDragEnd())}var se={active:!1},ce=new Set;function Xe(){let e=ce.size>0;if(se.active!==e){if(se.active=e,e){mn();return}vn()}}function Ge(e){ce.add(e),Xe()}function ue(e){ce.delete(e),Xe()}function bn(e){let{el:n,group:o,handleSelector:i,dragSelector:r,sortDisabled:a}=e;return ke.create(n,{dataIdAttr:"id",swapThreshold:.5,fallbackOnBody:!0,...gn,...!!r&&{draggable:r},...!!o&&{sort:!a,group:{name:o,...!!e.canPull&&{pull:(l,s,u,{newDraggableIndex:d,oldDraggableIndex:f})=>e.canPull({toEl:l.el,fromEl:s.el,dragEl:u,newIndex:d,oldIndex:f})},...!!e.canPut&&{put:(l,s,u,{newDraggableIndex:d,oldDraggableIndex:f})=>e.canPut({toEl:l.el,fromEl:s.el,dragEl:u,newIndex:d,oldIndex:f})}}},onMove:({from:l,dragged:s,to:u,related:d})=>{e.onDragMove&&e.onDragMove({fromEl:l,dragEl:s,toEl:u,relatedEl:d})},handle:i,filter:`${i}[disabled]`,onChoose:()=>{Ge(e)},onUnchoose:()=>{ue(e)},onStart:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{Ge(e),e.onDragStart({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})},onEnd:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{ue(e),e.onDragEnd({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})},onSort:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{e.onDragSort({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})}})}var Sn=()=>de((e,t)=>{let n;function o(a){return a.dragEnabled&&se.active}function i(a){o(a)||(r(a),a.dragEnabled&&(At.add(a),n=bn(a)))}function r(a){o(a)||(At.delete(a),n?.destroy(),n=void 0)}return t.onConnected(()=>{i(e)}),t.onDisconnected(()=>{At.delete(e),ue(e),r(e)}),{reset:()=>{i(e)}}});export{Sn as a};
|
|
2
|
+
import{b as de}from"./BKBRE6BE.js";function He(e,t,n){return(t=We(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$.apply(null,arguments)}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?he(Object(n),!0).forEach(function(o){He(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function je(e,t){if(e==null)return{};var n,o,i=Ke(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ke(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Le(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function We(e){var t=Le(e,"string");return typeof t=="symbol"?t:t+""}function Jt(e){"@babel/helpers - typeof";return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(e)}var ze="1.15.7";function U(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var q=U(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Tt=U(/Edge/i),pe=U(/firefox/i),Et=U(/safari/i)&&!U(/chrome/i)&&!U(/android/i),ie=U(/iP(ad|od|hone)/i),De=U(/chrome/i)&&U(/android/i),Se={capture:!1,passive:!1};function v(e,t,n){e.addEventListener(t,n,!q&&Se)}function m(e,t,n){e.removeEventListener(t,n,!q&&Se)}function Xt(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function _e(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function H(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Xt(e,t):Xt(e,t))||o&&e===n)return e;if(e===n)break}while(e=_e(e))}return null}var ge=/\s+/g;function R(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(ge," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(ge," ")}}function h(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function ft(e,t){var n="";if(typeof e=="string")n=e;else do{var o=h(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ce(e,t,n){if(e){var o=e.getElementsByTagName(t),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function K(){var e=document.scrollingElement;return e||document.documentElement}function T(e,t,n,o,i){if(!(!e.getBoundingClientRect&&e!==window)){var r,a,l,s,u,d,f;if(e!==window&&e.parentNode&&e!==K()?(r=e.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,u=r.right,d=r.height,f=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!q))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||n&&h(i,"position")!=="static")){var b=i.getBoundingClientRect();a-=b.top+parseInt(h(i,"border-top-width")),l-=b.left+parseInt(h(i,"border-left-width")),s=a+r.height,u=l+r.width;break}while(i=i.parentNode);if(o&&e!==window){var E=ft(i||e),y=E&&E.a,w=E&&E.d;E&&(a/=w,l/=y,f/=y,d/=w,s=a+d,u=l+f)}return{top:a,left:l,bottom:s,right:u,width:f,height:d}}}function me(e,t,n){for(var o=tt(e,!0),i=T(e)[t];o;){var r=T(o)[n],a=void 0;if(n==="top"||n==="left"?a=i>=r:a=i<=r,!a)return o;if(o===K())break;o=tt(o,!1)}return!1}function dt(e,t,n,o){for(var i=0,r=0,a=e.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==p.ghost&&(o||a[r]!==p.dragged)&&H(a[r],n.draggable,e,!1)){if(i===t)return a[r];i++}r++}return null}function re(e,t){for(var n=e.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||t&&!Xt(n,t));)n=n.previousElementSibling;return n||null}function G(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==p.clone&&(!t||Xt(e,t))&&n++;return n}function ve(e){var t=0,n=0,o=K();if(e)do{var i=ft(e),r=i.a,a=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*a}while(e!==o&&(e=e.parentNode));return[t,n]}function Ue(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function tt(e,t){if(!e||!e.getBoundingClientRect)return K();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=h(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return K();if(o||t)return n;o=!0}}while(n=n.parentNode);return K()}function $e(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Lt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Dt;function Te(e,t){return function(){if(!Dt){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Dt=setTimeout(function(){Dt=void 0},t)}}}function qe(){clearTimeout(Dt),Dt=void 0}function Oe(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ae(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Ie(e,t,n){var o={};return Array.from(e.children).forEach(function(i){var r,a,l,s;if(!(!H(i,t.draggable,e,!1)||i.animated||i===n)){var u=T(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,u.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,u.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,u.right),o.bottom=Math.max((s=o.bottom)!==null&&s!==void 0?s:-1/0,u.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var N="Sortable"+new Date().getTime();function Ve(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(h(i,"display")==="none"||i===p.ghost)){e.push({target:i,rect:T(i)});var r=L({},e[e.length-1].rect);if(i.thisAnimationDuration){var a=ft(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(Ue(e,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,a=0;e.forEach(function(l){var s=0,u=l.target,d=u.fromRect,f=T(u),b=u.prevFromRect,E=u.prevToRect,y=l.rect,w=ft(u,!0);w&&(f.top-=w.f,f.left-=w.e),u.toRect=f,u.thisAnimationDuration&&Lt(b,f)&&!Lt(d,f)&&(y.top-f.top)/(y.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(s=Qe(y,b,E,i.options)),Lt(f,d)||(u.prevFromRect=d,u.prevToRect=f,s||(s=i.options.animation),i.animate(u,y,f,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),e=[]},animate:function(o,i,r,a){if(a){h(o,"transition",""),h(o,"transform","");var l=ft(this.el),s=l&&l.a,u=l&&l.d,d=(i.left-r.left)/(s||1),f=(i.top-r.top)/(u||1);o.animatingX=!!d,o.animatingY=!!f,h(o,"transform","translate3d("+d+"px,"+f+"px,0)"),this.forRepaintDummy=Ze(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Ze(e){return e.offsetWidth}function Qe(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var lt=[],Wt={initializeByDefault:!0},Ot={mount:function(t){for(var n in Wt)Wt.hasOwnProperty(n)&&!(n in t)&&(t[n]=Wt[n]);lt.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),lt.push(t)},pluginEvent:function(t,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=t+"Global";lt.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](L({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][t]&&n[a.pluginName][t](L({sortable:n},o)))})},initializePlugins:function(t,n,o,i){lt.forEach(function(l){var s=l.pluginName;if(!(!t.options[s]&&!l.initializeByDefault)){var u=new l(t,n,t.options);u.sortable=t,u.options=t.options,t[s]=u,$(o,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,n){var o={};return lt.forEach(function(i){typeof i.eventProperties=="function"&&$(o,i.eventProperties.call(n[i.pluginName],t))}),o},modifyOption:function(t,n,o){var i;return lt.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(t[r.pluginName],o))}),i}};function Je(e){var t=e.sortable,n=e.rootEl,o=e.name,i=e.targetEl,r=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,d=e.oldDraggableIndex,f=e.newDraggableIndex,b=e.originalEvent,E=e.putSortable,y=e.extraEventProperties;if(t=t||n&&n[N],!!t){var w,X=t.options,W="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!q&&!Tt?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=l||n,w.item=i||n,w.clone=r,w.oldIndex=s,w.newIndex=u,w.oldDraggableIndex=d,w.newDraggableIndex=f,w.originalEvent=b,w.pullMode=E?E.lastPutMode:void 0;var I=L(L({},y),Ot.getEventProperties(o,t));for(var Y in I)w[Y]=I[Y];n&&n.dispatchEvent(w),X[W]&&X[W].call(t,w)}}var tn=["evt"],P=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=je(o,tn);Ot.pluginEvent.bind(p)(t,n,L({dragEl:c,parentEl:_,ghostEl:g,rootEl:D,nextEl:at,lastDownEl:Ft,cloneEl:S,cloneHidden:J,dragStarted:bt,putSortable:O,activeSortable:p.active,originalEvent:i,oldIndex:ct,oldDraggableIndex:St,newIndex:k,newDraggableIndex:Q,hideGhostForTarget:Me,unhideGhostForTarget:Fe,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(l){x({sortable:n,name:l,originalEvent:i})}},r))};function x(e){Je(L({putSortable:O,cloneEl:S,targetEl:c,rootEl:D,oldIndex:ct,oldDraggableIndex:St,newIndex:k,newDraggableIndex:Q},e))}var c,_,g,D,at,Ft,S,J,ct,k,St,Q,xt,O,ut=!1,Yt=!1,Bt=[],it,B,zt,Ut,be,ye,bt,st,_t,Ct=!1,Pt=!1,Rt,A,$t=[],te=!1,Ht=[],Kt=typeof document<"u",Nt=ie,we=Tt||q?"cssFloat":"float",en=Kt&&!De&&!ie&&"draggable"in document.createElement("div"),xe=(function(){if(Kt){if(q)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Pe=function(t,n){var o=h(t),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=dt(t,0,n),a=dt(t,1,n),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+T(r).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&o[we]==="none"||a&&o[we]==="none"&&u+d>i)?"vertical":"horizontal"},nn=function(t,n,o){var i=o?t.left:t.top,r=o?t.right:t.bottom,a=o?t.width:t.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return i===l||r===s||i+a/2===l+u/2},on=function(t,n){var o;return Bt.some(function(i){var r=i[N].options.emptyInsertThreshold;if(!(!r||re(i))){var a=T(i),l=t>=a.left-r&&t<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(l&&s)return o=i}}),o},Ne=function(t){function n(r,a){return function(l,s,u,d){var f=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,s,u,d),a)(l,s,u,d);var b=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===b||r.join&&r.indexOf(b)>-1}}var o={},i=t.group;(!i||Jt(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,t.group=o},Me=function(){!xe&&g&&h(g,"display","none")},Fe=function(){!xe&&g&&h(g,"display","")};Kt&&!De&&document.addEventListener("click",function(e){if(Yt)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Yt=!1,!1},!0);var rt=function(t){if(c){t=t.touches?t.touches[0]:t;var n=on(t.clientX,t.clientY);if(n){var o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[N]._onDragOver(o)}}},rn=function(t){c&&c.parentNode[N]._isOutsideThisEl(t.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$({},t),e[N]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&(!Et||ie),emptyInsertThreshold:5};Ot.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);Ne(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:en,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?v(e,"pointerdown",this._onTapStart):(v(e,"mousedown",this._onTapStart),v(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(e,"dragover",this),v(e,"dragenter",this)),Bt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$(this,Ve())}p.prototype={constructor:p,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(st=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,c):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(l||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,d=i.filter;if(hn(o),!c&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Et&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=H(s,i.draggable,o,!1),!(s&&s.animated)&&Ft!==s)){if(ct=G(s),St=G(s,i.draggable),typeof d=="function"){if(d.call(this,t,s,this)){x({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),P("filter",n,{evt:t}),r&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=H(u,f.trim(),o,!1),f)return x({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:o,toEl:o}),P("filter",n,{evt:t}),!0}),d)){r&&t.preventDefault();return}i.handle&&!H(u,i.handle,o,!1)||this._prepareDragStart(t,l,s)}}},_prepareDragStart:function(t,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(o&&!c&&o.parentNode===r){var u=T(o);if(D=r,c=o,_=c.parentNode,at=c.nextSibling,Ft=o,xt=a.group,p.dragged=c,it={target:c,clientX:(n||t).clientX,clientY:(n||t).clientY},be=it.clientX-u.left,ye=it.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,c.style["will-change"]="all",s=function(){if(P("delayEnded",i,{evt:t}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!pe&&i.nativeDraggable&&(c.draggable=!0),i._triggerDragStart(t,n),x({sortable:i,name:"choose",originalEvent:t}),R(c,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Ce(c,d.trim(),qt)}),v(l,"dragover",rt),v(l,"mousemove",rt),v(l,"touchmove",rt),a.supportPointer?(v(l,"pointerup",i._onDrop),!this.nativeDraggable&&v(l,"pointercancel",i._onDrop)):(v(l,"mouseup",i._onDrop),v(l,"touchend",i._onDrop),v(l,"touchcancel",i._onDrop)),pe&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),P("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Tt||q))){if(p.eventCanceled){this._onDrop();return}a.supportPointer?(v(l,"pointerup",i._disableDelayedDrag),v(l,"pointercancel",i._disableDelayedDrag)):(v(l,"mouseup",i._disableDelayedDrag),v(l,"touchend",i._disableDelayedDrag),v(l,"touchcancel",i._disableDelayedDrag)),v(l,"mousemove",i._delayedDragTouchMoveHandler),v(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&v(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){c&&qt(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"pointerup",this._disableDelayedDrag),m(t,"pointercancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):n?v(document,"touchmove",this._onTouchMove):v(document,"mousemove",this._onTouchMove):(v(c,"dragend",this),v(D,"dragstart",this._onDragStart));try{document.selection?kt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ut=!1,D&&c){P("dragStarted",this,{evt:n}),this.nativeDraggable&&v(document,"dragover",rn);var o=this.options;!t&&R(c,o.dragClass,!1),R(c,o.ghostClass,!0),p.active=this,t&&this._appendGhost(),x({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(B){this._lastX=B.clientX,this._lastY=B.clientY,Me();for(var t=document.elementFromPoint(B.clientX,B.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(B.clientX,B.clientY),t!==n);)n=t;if(c.parentNode[N]._isOutsideThisEl(t),n)do{if(n[N]){var o=void 0;if(o=n[N]._onDragOver({clientX:B.clientX,clientY:B.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=_e(n));Fe()}},_onTouchMove:function(t){if(it){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=t.touches?t.touches[0]:t,a=g&&ft(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Nt&&A&&ve(A),d=(r.clientX-it.clientX+i.x)/(l||1)+(u?u[0]-$t[0]:0)/(l||1),f=(r.clientY-it.clientY+i.y)/(s||1)+(u?u[1]-$t[1]:0)/(s||1);if(!p.active&&!ut){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(g){a?(a.e+=d-(zt||0),a.f+=f-(Ut||0)):a={a:1,b:0,c:0,d:1,e:d,f};var b="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(g,"webkitTransform",b),h(g,"mozTransform",b),h(g,"msTransform",b),h(g,"transform",b),zt=d,Ut=f,B=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!g){var t=this.options.fallbackOnBody?document.body:D,n=T(c,!0,Nt,!0,t),o=this.options;if(Nt){for(A=t;h(A,"position")==="static"&&h(A,"transform")==="none"&&A!==document;)A=A.parentNode;A!==document.body&&A!==document.documentElement?(A===document&&(A=K()),n.top+=A.scrollTop,n.left+=A.scrollLeft):A=K(),$t=ve(A)}g=c.cloneNode(!0),R(g,o.ghostClass,!1),R(g,o.fallbackClass,!0),R(g,o.dragClass,!0),h(g,"transition",""),h(g,"transform",""),h(g,"box-sizing","border-box"),h(g,"margin",0),h(g,"top",n.top),h(g,"left",n.left),h(g,"width",n.width),h(g,"height",n.height),h(g,"opacity","0.8"),h(g,"position",Nt?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,t.appendChild(g),h(g,"transform-origin",be/parseInt(g.style.width)*100+"% "+ye/parseInt(g.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,i=t.dataTransfer,r=o.options;if(P("dragStart",this,{evt:t}),p.eventCanceled){this._onDrop();return}P("setupClone",this),p.eventCanceled||(S=Ae(c),S.removeAttribute("id"),S.draggable=!1,S.style["will-change"]="",this._hideClone(),R(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=kt(function(){P("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||D.insertBefore(S,c),o._hideClone(),x({sortable:o,name:"clone"}))}),!n&&R(c,r.dragClass,!0),n?(Yt=!0,o._loopId=setInterval(o._emulateDragOver,50)):(m(document,"mouseup",o._onDrop),m(document,"touchend",o._onDrop),m(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,c)),v(document,"drop",o),h(c,"transform","translateZ(0)")),ut=!0,o._dragStartId=kt(o._dragStarted.bind(o,n,t)),v(document,"selectstart",o),bt=!0,window.getSelection().removeAllRanges(),Et&&h(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,i,r,a,l=this.options,s=l.group,u=p.active,d=xt===s,f=l.sort,b=O||u,E,y=this,w=!1;if(te)return;function X(vt,Ye){P(vt,y,L({evt:t,isOwner:d,axis:E?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:b,target:o,completed:I,onMove:function(fe,Be){return Mt(D,n,c,i,fe,T(fe),t,Be)},changed:Y},Ye))}function W(){X("dragOverAnimationCapture"),y.captureAnimationState(),y!==b&&b.captureAnimationState()}function I(vt){return X("dragOverCompleted",{insertion:vt}),vt&&(d?u._hideClone():u._showClone(y),y!==b&&(R(c,O?O.options.ghostClass:u.options.ghostClass,!1),R(c,l.ghostClass,!0)),O!==y&&y!==p.active?O=y:y===p.active&&O&&(O=null),b===y&&(y._ignoreWhileAnimating=o),y.animateAll(function(){X("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===c&&!c.animated||o===n&&!o.animated)&&(st=null),!l.dragoverBubble&&!t.rootEl&&o!==document&&(c.parentNode[N]._isOutsideThisEl(t.target),!vt&&rt(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),w=!0}function Y(){k=G(c),Q=G(c,l.draggable),x({sortable:y,name:"change",toEl:n,newIndex:k,newDraggableIndex:Q,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=H(o,l.draggable,n,!0),X("dragOver"),p.eventCanceled)return w;if(c.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||y._ignoreWhileAnimating===o)return I(!1);if(Yt=!1,u&&!l.disabled&&(d?f||(a=_!==D):O===this||(this.lastPutMode=xt.checkPull(this,u,c,t))&&s.checkPut(this,u,c,t))){if(E=this._getDirection(t,o)==="vertical",i=T(c),X("dragOverValid"),p.eventCanceled)return w;if(a)return _=D,W(),this._hideClone(),X("revert"),p.eventCanceled||(at?D.insertBefore(c,at):D.appendChild(c)),I(!0);var M=re(n,l.draggable);if(!M||un(t,E,this)&&!M.animated){if(M===c)return I(!1);if(M&&n===t.target&&(o=M),o&&(r=T(o)),Mt(D,n,c,i,o,r,t,!!o)!==!1)return W(),M&&M.nextSibling?n.insertBefore(c,M.nextSibling):n.appendChild(c),_=n,Y(),I(!0)}else if(M&&sn(t,E,this)){var et=dt(n,0,l,!0);if(et===c)return I(!1);if(o=et,r=T(o),Mt(D,n,c,i,o,r,t,!1)!==!1)return W(),n.insertBefore(c,et),_=n,Y(),I(!0)}else if(o.parentNode===n){r=T(o);var j=0,nt,ht=c.parentNode!==n,F=!nn(c.animated&&c.toRect||i,o.animated&&o.toRect||r,E),pt=E?"top":"left",V=me(o,"top","top")||me(c,"top","top"),gt=V?V.scrollTop:void 0;st!==o&&(nt=r[pt],Ct=!1,Pt=!F&&l.invertSwap||ht),j=cn(t,o,r,E,F?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Pt,st===o);var z;if(j!==0){var ot=G(c);do ot-=j,z=_.children[ot];while(z&&(h(z,"display")==="none"||z===g))}if(j===0||z===o)return I(!1);st=o,_t=j;var mt=o.nextElementSibling,Z=!1;Z=j===1;var It=Mt(D,n,c,i,o,r,t,Z);if(It!==!1)return(It===1||It===-1)&&(Z=It===1),te=!0,setTimeout(ln,30),W(),Z&&!mt?n.appendChild(c):o.parentNode.insertBefore(c,Z?mt:o),V&&Oe(V,0,gt-V.scrollTop),_=c.parentNode,nt!==void 0&&!Pt&&(Rt=Math.abs(nt-T(o)[pt])),Y(),I(!0)}if(n.contains(c))return I(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",rt),m(document,"mousemove",rt),m(document,"touchmove",rt)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"pointercancel",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(k=G(c),Q=G(c,o.draggable),P("drop",this,{evt:t}),_=c&&c.parentNode,k=G(c),Q=G(c,o.draggable),p.eventCanceled){this._nulling();return}ut=!1,Pt=!1,Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ee(this.cloneId),ee(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Et&&h(document.body,"user-select",""),h(c,"transform",""),t&&(bt&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(D===_||O&&O.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),c&&(this.nativeDraggable&&m(c,"dragend",this),qt(c),c.style["will-change"]="",bt&&!ut&&R(c,O?O.options.ghostClass:this.options.ghostClass,!1),R(c,this.options.chosenClass,!1),x({sortable:this,name:"unchoose",toEl:_,newIndex:null,newDraggableIndex:null,originalEvent:t}),D!==_?(k>=0&&(x({rootEl:_,name:"add",toEl:_,fromEl:D,originalEvent:t}),x({sortable:this,name:"remove",toEl:_,originalEvent:t}),x({rootEl:_,name:"sort",toEl:_,fromEl:D,originalEvent:t}),x({sortable:this,name:"sort",toEl:_,originalEvent:t})),O&&O.save()):k!==ct&&k>=0&&(x({sortable:this,name:"update",toEl:_,originalEvent:t}),x({sortable:this,name:"sort",toEl:_,originalEvent:t})),p.active&&((k==null||k===-1)&&(k=ct,Q=St),x({sortable:this,name:"end",toEl:_,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){P("nulling",this),D=c=_=g=at=S=Ft=J=it=B=bt=k=Q=ct=St=st=_t=O=xt=p.dragged=p.ghost=p.clone=p.active=null;var t=this.el;Ht.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Ht.length=zt=Ut=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":c&&(this._onDragOver(t),an(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],H(n,a.draggable,this.el,!1)&&t.push(n.getAttribute(a.dataIdAttr)||dn(n));return t},sort:function(t,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];H(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return H(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var i=Ot.modifyOption(this,t,n);typeof i<"u"?o[t]=i:o[t]=n,t==="group"&&Ne(o)},destroy:function(){P("destroy",this);var t=this.el;t[N]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Bt.splice(Bt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!J){if(P("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),J=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(J){if(P("showClone",this),p.eventCanceled)return;c.parentNode==D&&!this.options.group.revertClone?D.insertBefore(S,c):at?D.insertBefore(S,at):D.appendChild(S),this.options.group.revertClone&&this.animate(c,S),h(S,"display",""),J=!1}}};function an(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Mt(e,t,n,o,i,r,a,l){var s,u=e[N],d=u.options.onMove,f;return window.CustomEvent&&!q&&!Tt?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=t,s.from=e,s.dragged=n,s.draggedRect=o,s.related=i||t,s.relatedRect=r||T(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),d&&(f=d.call(u,s,a)),f}function qt(e){e.draggable=!1}function ln(){te=!1}function sn(e,t,n){var o=T(dt(n.el,0,n.options,!0)),i=Ie(n.el,n.options,g),r=10;return t?e.clientX<i.left-r||e.clientY<o.top&&e.clientX<o.right:e.clientY<i.top-r||e.clientY<o.bottom&&e.clientX<o.left}function un(e,t,n){var o=T(re(n.el,n.options.draggable)),i=Ie(n.el,n.options,g),r=10;return t?e.clientX>i.right+r||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>i.bottom+r||e.clientX>o.right&&e.clientY>o.top}function cn(e,t,n,o,i,r,a,l){var s=o?e.clientY:e.clientX,u=o?n.height:n.width,d=o?n.top:n.left,f=o?n.bottom:n.right,b=!1;if(!a){if(l&&Rt<u*i){if(!Ct&&(_t===1?s>d+u*r/2:s<f-u*r/2)&&(Ct=!0),Ct)b=!0;else if(_t===1?s<d+Rt:s>f-Rt)return-_t}else if(s>d+u*(1-i)/2&&s<f-u*(1-i)/2)return fn(t)}return b=b||a,b&&(s<d+u*r/2||s>f-u*r/2)?s>d+u/2?1:-1:0}function fn(e){return G(c)<G(e)?1:-1}function dn(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function hn(e){Ht.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Ht.push(o)}}function kt(e){return setTimeout(e,0)}function ee(e){return clearTimeout(e)}Kt&&v(document,"touchmove",function(e){(p.active||ut)&&e.cancelable&&e.preventDefault()});p.utils={on:v,off:m,css:h,find:Ce,is:function(t,n){return!!H(t,n,t,!1)},extend:$e,throttle:Te,closest:H,toggleClass:R,clone:Ae,index:G,nextTick:kt,cancelNextTick:ee,detectDirection:Pe,getChild:dt,expando:N};p.get=function(e){return e[N]};p.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=L(L({},p.utils),o.utils)),Ot.mount(o)})};p.create=function(e,t){return new p(e,t)};p.version=ze;var C=[],yt,ne,oe=!1,Vt,Zt,jt,wt;function pn(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):o.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),Ee(),Gt(),qe()},nulling:function(){jt=ne=yt=oe=wt=Vt=Zt=null,C.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(jt=n,o||this.options.forceAutoScrollFallback||Tt||q||Et){Qt(n,this.options,l,o);var s=tt(l,!0);oe&&(!wt||r!==Vt||a!==Zt)&&(wt&&Ee(),wt=setInterval(function(){var u=tt(document.elementFromPoint(r,a),!0);u!==s&&(s=u,Gt()),Qt(n,i.options,u,o)},10),Vt=r,Zt=a)}else{if(!this.options.bubbleScroll||tt(l,!0)===K()){Gt();return}Qt(n,this.options,tt(l,!1),!1)}}},$(e,{pluginName:"scroll",initializeByDefault:!0})}function Gt(){C.forEach(function(e){clearInterval(e.pid)}),C=[]}function Ee(){clearInterval(wt)}var Qt=Te(function(e,t,n,o){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,s=K(),u=!1,d;ne!==n&&(ne=n,Gt(),yt=t.scroll,d=t.scrollFn,yt===!0&&(yt=tt(n,!0)));var f=0,b=yt;do{var E=b,y=T(E),w=y.top,X=y.bottom,W=y.left,I=y.right,Y=y.width,M=y.height,et=void 0,j=void 0,nt=E.scrollWidth,ht=E.scrollHeight,F=h(E),pt=E.scrollLeft,V=E.scrollTop;E===s?(et=Y<nt&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),j=M<ht&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(et=Y<nt&&(F.overflowX==="auto"||F.overflowX==="scroll"),j=M<ht&&(F.overflowY==="auto"||F.overflowY==="scroll"));var gt=et&&(Math.abs(I-i)<=a&&pt+Y<nt)-(Math.abs(W-i)<=a&&!!pt),z=j&&(Math.abs(X-r)<=a&&V+M<ht)-(Math.abs(w-r)<=a&&!!V);if(!C[f])for(var ot=0;ot<=f;ot++)C[ot]||(C[ot]={});(C[f].vx!=gt||C[f].vy!=z||C[f].el!==E)&&(C[f].el=E,C[f].vx=gt,C[f].vy=z,clearInterval(C[f].pid),(gt!=0||z!=0)&&(u=!0,C[f].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove(jt);var mt=C[this.layer].vy?C[this.layer].vy*l:0,Z=C[this.layer].vx?C[this.layer].vx*l:0;typeof d=="function"&&d.call(p.dragged.parentNode[N],Z,mt,e,jt,C[this.layer].el)!=="continue"||Oe(C[this.layer].el,Z,mt)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&b!==s&&(b=tt(b,!1)));oe=u}},30),Re=function(t){var n=t.originalEvent,o=t.putSortable,i=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,l=t.hideGhostForTarget,s=t.unhideGhostForTarget;if(n){var u=o||r;l();var d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(d.clientX,d.clientY);s(),u&&!u.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function ae(){}ae.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=dt(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Re};$(ae,{pluginName:"revertOnSpill"});function le(){}le.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,i=o||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:Re};$(le,{pluginName:"removeOnSpill"});p.mount(new pn);p.mount(le,ae);var ke=p;var At=new Set,gn={ghostClass:"calcite-sortable--ghost",chosenClass:"calcite-sortable--chosen",dragClass:"calcite-sortable--drag",fallbackClass:"calcite-sortable--fallback"};function mn(){Array.from(At).forEach(e=>e.onGlobalDragStart())}function vn(){Array.from(At).forEach(e=>e.onGlobalDragEnd())}var se={active:!1},ce=new Set;function Xe(){let e=ce.size>0;if(se.active!==e){if(se.active=e,e){mn();return}vn()}}function Ge(e){ce.add(e),Xe()}function ue(e){ce.delete(e),Xe()}function bn(e){let{el:n,group:o,handleSelector:i,dragSelector:r,sortDisabled:a}=e;return ke.create(n,{dataIdAttr:"id",swapThreshold:.5,fallbackOnBody:!0,...gn,...!!r&&{draggable:r},...!!o&&{sort:!a,group:{name:o,...!!e.canPull&&{pull:(l,s,u,{newDraggableIndex:d,oldDraggableIndex:f})=>e.canPull({toEl:l.el,fromEl:s.el,dragEl:u,newIndex:d,oldIndex:f})},...!!e.canPut&&{put:(l,s,u,{newDraggableIndex:d,oldDraggableIndex:f})=>e.canPut({toEl:l.el,fromEl:s.el,dragEl:u,newIndex:d,oldIndex:f})}}},onMove:({from:l,dragged:s,to:u,related:d})=>{e.onDragMove&&e.onDragMove({fromEl:l,dragEl:s,toEl:u,relatedEl:d})},handle:i,filter:`${i}[disabled]`,onChoose:()=>{Ge(e)},onUnchoose:()=>{ue(e)},onStart:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{Ge(e),e.onDragStart({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})},onEnd:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{ue(e),e.onDragEnd({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})},onSort:({from:l,item:s,to:u,newDraggableIndex:d,oldDraggableIndex:f})=>{e.onDragSort({fromEl:l,dragEl:s,toEl:u,newIndex:d,oldIndex:f})}})}var Sn=()=>de((e,t)=>{let n;function o(a){return a.dragEnabled&&se.active}function i(a){o(a)||(r(a),a.dragEnabled&&(At.add(a),n=bn(a)))}function r(a){o(a)||(At.delete(a),n?.destroy(),n=void 0)}return t.onConnected(()=>{i(e)}),t.onDisconnected(()=>{At.delete(e),ue(e),r(e)}),{reset:()=>{i(e)}}});export{Sn as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as M}from"./
|
|
2
|
+
import{a as M}from"./SHDZO7WL.js";import{e as c}from"./UWAER5W3.js";import{a as C}from"./DEJB6LKH.js";import{a as A}from"./YGO2VHM5.js";import{a as G}from"./OIO5CL6R.js";import{a as S}from"./VI7SBYXT.js";import{a as y}from"./ADXJH4JG.js";import"./ZWPNZ5XW.js";import"./BKBRE6BE.js";import"./NRGZYLHS.js";import{f as D,u as x}from"./RJUGARBU.js";import{a as O}from"./T6CCMW7H.js";import{G as I,H as h,N as B,S as E,g as k,h as p,p as d}from"./OD4W6GP7.js";var m={container:"container",groupContainer:"group-container",scrim:"scrim",assistiveText:"assistive-text"},b="calcite-block-group",f="calcite-block",P=k`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}.container{position:relative}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;function H(u){u.forEach(e=>{e.setPosition=u.indexOf(e)+1,e.setSize=u.length})}var g=class extends I{constructor(){super(),this.dragSelector=f,this.handleSelector="calcite-sort-handle",this.mutationObserver=S("mutation",()=>{this.updateBlockItemsDebounced()}),this.blockAndGroups=[],this.cancelable=A()(this),this.focusSetter=y()(this),this.sortable=M()(this),this.updateBlockItemsDebounced=G(this.updateBlockItems,B.nextTick),this.interactiveContainer=C(this),this.sortHandleMenuItems=[],this.disabled=!1,this.dragEnabled=!1,this.loading=!1,this.scale="m",this.sortDisabled=!1,this.calciteBlockGroupDragEnd=d({cancelable:!1}),this.calciteBlockGroupDragStart=d({cancelable:!1}),this.calciteBlockGroupMoveHalt=d({cancelable:!1}),this.calciteBlockGroupOrderChange=d({cancelable:!1}),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteBlockSortHandleBeforeOpen",this.updateBlockItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd)}static{this.properties={assistiveText:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],group:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=P}emitOrderChangeEvent(e){this.calciteBlockGroupOrderChange.emit(e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.updateBlockItemsDebounced(),this.sortable.reset(),this.setParentBlockGroup(),this.cancelable.add(this.updateBlockItemsDebounced)}willUpdate(e){(e.has("group")||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1))&&this.updateBlockItemsDebounced(),e.has("scale")&&this.hasUpdated&&this.updateBlockAndGroupScale()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver()}updateBlockItems(){this.updateGroupItems();let{dragEnabled:e,el:a,sortDisabled:t,sortHandleMenuItems:o}=this,s=Array.from(this.el.querySelectorAll(f)),n=a,l=Array.from(n.children).filter(c);s.forEach(r=>{r.closest(b)===a&&(r.moveToItems=o.filter(i=>this.validateSortMenuItem({type:"move",fromEl:n,toEl:i.element,dragEl:r,newIndex:0,oldIndex:l.indexOf(r)})),r.addToItems=this.sortHandleMenuItems.filter(i=>this.validateSortMenuItem({type:"add",fromEl:n,toEl:i.element,dragEl:r,newIndex:0,oldIndex:l.indexOf(r)})),r.dragHandle=e,r.sortDisabled=t)}),this.sortable.reset()}updateGroupItems(){let{el:e,group:a}=this,t=D(e),o=a?Array.from(t.querySelectorAll(`${b}[group="${a}"]`)).filter(s=>!s.disabled&&s.dragEnabled):[];this.sortHandleMenuItems=o.map(s=>({element:s,label:s.label??s.id,id:O()}))}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentBlockGroupEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentBlockGroupEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentBlockGroupEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteBlockGroupDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteBlockGroupDragStart.emit(e)}onDragSort(e){this.setParentBlockGroup(),this.updateBlockItemsDebounced(),this.calciteBlockGroupOrderChange.emit(e)}setParentBlockGroup(){this.parentBlockGroupEl=this.el.parentElement?.closest(b)||void 0}handleDefaultSlotChange(e){let a=[];this.blockAndGroups=x(e).filter(t=>(c(t)&&a.push(t),t.matches(f)||t.matches(b))),H(a),this.updateBlockAndGroupScale()}updateBlockAndGroupScale(){this.blockAndGroups.forEach(e=>{e.scale=this.scale})}validateSortMenuItem({fromEl:e,toEl:a,dragEl:t,newIndex:o,oldIndex:s,type:n}){if(!e||!a||a===e||t.contains(a))return!1;let l=e.canPull?.({toEl:a,fromEl:e,dragEl:t,newIndex:o,oldIndex:s})??!0,r=a.canPut?.({toEl:a,fromEl:e,dragEl:t,newIndex:o,oldIndex:s})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:a}=e.detail,t=e.target,o=t?.parentElement,s=a.element,l=Array.from(o.children).filter(c).indexOf(t),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:o,toEl:s,dragEl:t,newIndex:r,oldIndex:l}))return;t.sortHandleOpen=!1,this.disconnectObserver();let i=t.cloneNode();s.prepend(i),this.updateBlockItemsDebounced(),this.connectObserver();let v={dragEl:t,fromEl:o,toEl:s,newIndex:r,oldIndex:l};this.calciteBlockGroupOrderChange.emit(v),s.emitOrderChangeEvent(v)}handleMove(e){let{moveTo:a}=e.detail,t=e.target,o=t?.parentElement,s=a.element,l=Array.from(o.children).filter(c).indexOf(t),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:o,toEl:s,dragEl:t,newIndex:r,oldIndex:l}))return;t.sortHandleOpen=!1,this.disconnectObserver(),s.prepend(t),this.updateBlockItemsDebounced(),this.connectObserver();let i={dragEl:t,fromEl:o,toEl:s,newIndex:r,oldIndex:l};this.calciteBlockGroupOrderChange.emit(i),s.emitOrderChangeEvent(i)}handleReorder(e){let{reorder:a}=e.detail,t=e.target,o=t?.parentElement;if(!o)return;t.sortHandleOpen=!1;let s=Array.from(o.children).filter(c),n=s.length-1,l=s.indexOf(t),r=l;switch(a){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let i=a==="up"||a==="top"?s[r]:s[r].nextSibling;o.insertBefore(t,i),this.updateBlockItemsDebounced(),this.connectObserver(),this.calciteBlockGroupOrderChange.emit({dragEl:t,fromEl:o,toEl:o,newIndex:r,oldIndex:l})}render(){let{loading:e,label:a}=this;return this.interactiveContainer({disabled:this.disabled,children:p`<div class=${h(m.container)}>${this.dragEnabled?p`<span aria-live=assertive class=${h(m.assistiveText)}>${this.assistiveText}</span>`:null}${e?p`<calcite-scrim class=${h(m.scrim)} .loading=${e}></calcite-scrim>`:null}<div .ariaBusy=${e} .ariaLabel=${a||""} class=${h(m.groupContainer)} role=group><slot @slotchange=${this.handleDefaultSlotChange}></slot></div></div>`})}};E("calcite-block-group",g);export{g as BlockGroup};
|