From a4db4fa3c927ec314c2b25453e1707747cd82560 Mon Sep 17 00:00:00 2001 From: Stef Blokdijk Date: Thu, 25 Aug 2022 18:07:20 -0300 Subject: [PATCH] Recompiled to use the latest DependentFormField mixing from Nova 4.13.0 --- dist/js/field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/js/field.js b/dist/js/field.js index 7734b57..14301e6 100644 --- a/dist/js/field.js +++ b/dist/js/field.js @@ -1,2 +1,2 @@ /*! For license information please see field.js.LICENSE.txt */ -(()=>{var e,t={5691:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={computed:{fieldValue:function(){return this.field.displayedAs||this.field.value},formattedValue:function(){return void 0===this.fieldValue||null===this.fieldValue?"-":this.fieldValue.toLocaleString(this.field.locale,{style:"currency",currency:this.field.currency,minimumFractionDigits:2,maximumFractionDigits:this.field.subUnits})}}}},5757:(e,t,r)=>{Nova.booting((function(e,t){e.component("index-nova-money-field",r(6009).Z),e.component("detail-nova-money-field",r(4365).Z),e.component("form-nova-money-field",r(8423).Z)}))},9129:()=>{},3744:(e,t)=>{"use strict";t.Z=(e,t)=>{const r=e.__vccOpts||e;for(const[e,n]of t)r[e]=n;return r}},4365:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(311),o={class:"text-90"};const i={props:["resource","resourceName","resourceId","field"],mixins:[r(5691).Z]};const a=(0,r(3744).Z)(i,[["render",function(e,t,r,i,a,s){var u=(0,n.resolveComponent)("PanelItem");return(0,n.openBlock)(),(0,n.createBlock)(u,{field:r.field},{value:(0,n.withCtx)((function(){return[(0,n.createElementVNode)("p",o,(0,n.toDisplayString)(e.formattedValue),1)]})),_:1},8,["field"])}]])},8423:(e,t,r)=>{"use strict";r.d(t,{Z:()=>Ne});var n=r(311),o={class:"flex flex-wrap items-stretch w-full relative"},i={class:"flex -mr-px"},a={class:"flex items-center bg-gray-100 rounded rounded-r-none px-3 whitespace-no-wrap text-sm form-control form-input-bordered"},s=["value","id","disabled"];var u=r(3906),c=r.n(u),l={preventInitialLoading:{type:Boolean,default:!1},showHelpText:{type:Boolean,default:!1},shownViaNewRelationModal:{type:Boolean,default:!1},resourceId:{type:[Number,String]},resourceName:{type:String},relatedResourceId:{type:[Number,String]},relatedResourceName:{type:String},field:{type:Object,required:!0},viaResource:{type:String,required:!1},viaResourceId:{type:[String,Number],required:!1},viaRelationship:{type:String,required:!1},relationshipType:{type:String,default:""},shouldOverrideMeta:{type:Boolean,default:!1},disablePagination:{type:Boolean,default:!1},clickAction:{type:String,default:"view",validator:function(e){return["edit","select","ignore","detail"].includes(e)}}};function f(e){return c()(l,e)}function p(){return"undefined"!=typeof navigator&&"undefined"!=typeof window?window:void 0!==r.g?r.g:{}}const d="function"==typeof Proxy;let h,y;function v(){return void 0!==h||("undefined"!=typeof window&&window.performance?(h=!0,y=window.performance):void 0!==r.g&&(null===(e=r.g.perf_hooks)||void 0===e?void 0:e.performance)?(h=!0,y=r.g.perf_hooks.performance):h=!1),h?y.now():Date.now();var e}class m{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const r={};if(e.settings)for(const t in e.settings){const n=e.settings[t];r[t]=n.defaultValue}const n=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const e=localStorage.getItem(n),t=JSON.parse(e);Object.assign(o,t)}catch(e){}this.fallbacks={getSettings:()=>o,setSettings(e){try{localStorage.setItem(n,JSON.stringify(e))}catch(e){}o=e},now:()=>v()},t&&t.on("plugin:settings:set",((e,t)=>{e===this.plugin.id&&this.fallbacks.setSettings(t)})),this.proxiedOn=new Proxy({},{get:(e,t)=>this.target?this.target.on[t]:(...e)=>{this.onQueue.push({method:t,args:e})}}),this.proxiedTarget=new Proxy({},{get:(e,t)=>this.target?this.target[t]:"on"===t?this.proxiedOn:Object.keys(this.fallbacks).includes(t)?(...e)=>(this.targetQueue.push({method:t,args:e,resolve:()=>{}}),this.fallbacks[t](...e)):(...e)=>new Promise((r=>{this.targetQueue.push({method:t,args:e,resolve:r})}))})}async setRealTarget(e){this.target=e;for(const e of this.onQueue)this.target.on[e.method](...e.args);for(const e of this.targetQueue)e.resolve(await this.target[e.method](...e.args))}}function g(e,t){const r=e,n=p(),o=p().__VUE_DEVTOOLS_GLOBAL_HOOK__,i=d&&r.enableEarlyProxy;if(!o||!n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__&&i){const e=i?new m(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:t,proxy:e}),e&&t(e.proxiedTarget)}else o.emit("devtools-plugin:setup",e,t)}var b="store";function w(e,t){Object.keys(e).forEach((function(r){return t(e[r],r)}))}function O(e){return null!==e&&"object"==typeof e}function j(e,t,r){return t.indexOf(e)<0&&(r&&r.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function x(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var r=e.state;_(e,r,[],e._modules.root,!0),S(e,r,t)}function S(e,t,r){var o=e._state;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,a={};w(i,(function(t,r){a[r]=function(e,t){return function(){return e(t)}}(t,e),Object.defineProperty(e.getters,r,{get:function(){return a[r]()},enumerable:!0})})),e._state=(0,n.reactive)({data:t}),e.strict&&function(e){(0,n.watch)((function(){return e._state.data}),(function(){0}),{deep:!0,flush:"sync"})}(e),o&&r&&e._withCommit((function(){o.data=null}))}function _(e,t,r,n,o){var i=!r.length,a=e._modules.getNamespace(r);if(n.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=n),!i&&!o){var s=E(t,r.slice(0,-1)),u=r[r.length-1];e._withCommit((function(){s[u]=n.state}))}var c=n.context=function(e,t,r){var n=""===t,o={dispatch:n?e.dispatch:function(r,n,o){var i=A(r,n,o),a=i.payload,s=i.options,u=i.type;return s&&s.root||(u=t+u),e.dispatch(u,a)},commit:n?e.commit:function(r,n,o){var i=A(r,n,o),a=i.payload,s=i.options,u=i.type;s&&s.root||(u=t+u),e.commit(u,a,s)}};return Object.defineProperties(o,{getters:{get:n?function(){return e.getters}:function(){return P(e,t)}},state:{get:function(){return E(e.state,r)}}}),o}(e,a,r);n.forEachMutation((function(t,r){!function(e,t,r,n){(e._mutations[t]||(e._mutations[t]=[])).push((function(t){r.call(e,n.state,t)}))}(e,a+r,t,c)})),n.forEachAction((function(t,r){var n=t.root?r:a+r,o=t.handler||t;!function(e,t,r,n){(e._actions[t]||(e._actions[t]=[])).push((function(t){var o,i=r.call(e,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:e.getters,rootState:e.state},t);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),e._devtoolHook?i.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):i}))}(e,n,o,c)})),n.forEachGetter((function(t,r){!function(e,t,r,n){if(e._wrappedGetters[t])return void 0;e._wrappedGetters[t]=function(e){return r(n.state,n.getters,e.state,e.getters)}}(e,a+r,t,c)})),n.forEachChild((function(n,i){_(e,t,r.concat(i),n,o)}))}function P(e,t){if(!e._makeLocalGettersCache[t]){var r={},n=t.length;Object.keys(e.getters).forEach((function(o){if(o.slice(0,n)===t){var i=o.slice(n);Object.defineProperty(r,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=r}return e._makeLocalGettersCache[t]}function E(e,t){return t.reduce((function(e,t){return e[t]}),e)}function A(e,t,r){return O(e)&&e.type&&(r=t,t=e,e=e.type),{type:e,payload:t,options:r}}var k="vuex:mutations",F="vuex:actions",I="vuex",N=0;function T(e,t){g({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:["vuex bindings"]},(function(r){r.addTimelineLayer({id:k,label:"Vuex Mutations",color:C}),r.addTimelineLayer({id:F,label:"Vuex Actions",color:C}),r.addInspector({id:I,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),r.on.getInspectorTree((function(r){if(r.app===e&&r.inspectorId===I)if(r.filter){var n=[];L(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[D(t._modules.root,"")]})),r.on.getInspectorState((function(r){if(r.app===e&&r.inspectorId===I){var n=r.nodeId;P(t,n),r.state=function(e,t,r){t="root"===r?t:t[r];var n=Object.keys(t),o={state:Object.keys(e.state).map((function(t){return{key:t,editable:!0,value:e.state[t]}}))};if(n.length){var i=function(e){var t={};return Object.keys(e).forEach((function(r){var n=r.split("/");if(n.length>1){var o=t,i=n.pop();n.forEach((function(e){o[e]||(o[e]={_custom:{value:{},display:e,tooltip:"Module",abstract:!0}}),o=o[e]._custom.value})),o[i]=V((function(){return e[r]}))}else t[r]=V((function(){return e[r]}))})),t}(t);o.getters=Object.keys(i).map((function(e){return{key:e.endsWith("/")?M(e):e,editable:!1,value:V((function(){return i[e]}))}}))}return o}((o=t._modules,(a=(i=n).split("/").filter((function(e){return e}))).reduce((function(e,t,r){var n=e[t];if(!n)throw new Error('Missing module "'+t+'" for path "'+i+'".');return r===a.length-1?n:n._children}),"root"===i?o:o.root._children)),"root"===n?t.getters:t._makeLocalGettersCache,n)}var o,i,a})),r.on.editInspectorState((function(r){if(r.app===e&&r.inspectorId===I){var n=r.nodeId,o=r.path;"root"!==n&&(o=n.split("/").filter(Boolean).concat(o)),t._withCommit((function(){r.set(t._state.data,o,r.state.value)}))}})),t.subscribe((function(e,t){var n={};e.payload&&(n.payload=e.payload),n.state=t,r.notifyComponentUpdate(),r.sendInspectorTree(I),r.sendInspectorState(I),r.addTimelineEvent({layerId:k,event:{time:Date.now(),title:e.type,data:n}})})),t.subscribeAction({before:function(e,t){var n={};e.payload&&(n.payload=e.payload),e._id=N++,e._time=Date.now(),n.state=t,r.addTimelineEvent({layerId:F,event:{time:e._time,title:e.type,groupId:e._id,subtitle:"start",data:n}})},after:function(e,t){var n={},o=Date.now()-e._time;n.duration={_custom:{type:"duration",display:o+"ms",tooltip:"Action duration",value:o}},e.payload&&(n.payload=e.payload),n.state=t,r.addTimelineEvent({layerId:F,event:{time:Date.now(),title:e.type,groupId:e._id,subtitle:"end",data:n}})}})}))}var C=8702998,R={label:"namespaced",textColor:16777215,backgroundColor:6710886};function M(e){return e&&"root"!==e?e.split("/").slice(-2,-1)[0]:"Root"}function D(e,t){return{id:t||"root",label:M(t),tags:e.namespaced?[R]:[],children:Object.keys(e._children).map((function(r){return D(e._children[r],t+r+"/")}))}}function L(e,t,r,n){n.includes(r)&&e.push({id:n||"root",label:n.endsWith("/")?n.slice(0,n.length-1):n||"Root",tags:t.namespaced?[R]:[]}),Object.keys(t._children).forEach((function(o){L(e,t._children[o],r,n+o+"/")}))}function V(e){try{return e()}catch(e){return e}}var U=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var r=e.state;this.state=("function"==typeof r?r():r)||{}},B={namespaced:{configurable:!0}};B.namespaced.get=function(){return!!this._rawModule.namespaced},U.prototype.addChild=function(e,t){this._children[e]=t},U.prototype.removeChild=function(e){delete this._children[e]},U.prototype.getChild=function(e){return this._children[e]},U.prototype.hasChild=function(e){return e in this._children},U.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},U.prototype.forEachChild=function(e){w(this._children,e)},U.prototype.forEachGetter=function(e){this._rawModule.getters&&w(this._rawModule.getters,e)},U.prototype.forEachAction=function(e){this._rawModule.actions&&w(this._rawModule.actions,e)},U.prototype.forEachMutation=function(e){this._rawModule.mutations&&w(this._rawModule.mutations,e)},Object.defineProperties(U.prototype,B);var $=function(e){this.register([],e,!1)};function q(e,t,r){if(t.update(r),r.modules)for(var n in r.modules){if(!t.getChild(n))return void 0;q(e.concat(n),t.getChild(n),r.modules[n])}}$.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},$.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,r){return e+((t=t.getChild(r)).namespaced?r+"/":"")}),"")},$.prototype.update=function(e){q([],this.root,e)},$.prototype.register=function(e,t,r){var n=this;void 0===r&&(r=!0);var o=new U(t,r);0===e.length?this.root=o:this.get(e.slice(0,-1)).addChild(e[e.length-1],o);t.modules&&w(t.modules,(function(t,o){n.register(e.concat(o),t,r)}))},$.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),r=e[e.length-1],n=t.getChild(r);n&&n.runtime&&t.removeChild(r)},$.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),r=e[e.length-1];return!!t&&t.hasChild(r)};var W=function(e){var t=this;void 0===e&&(e={});var r=e.plugins;void 0===r&&(r=[]);var n=e.strict;void 0===n&&(n=!1);var o=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new $(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._devtools=o;var i=this,a=this.dispatch,s=this.commit;this.dispatch=function(e,t){return a.call(i,e,t)},this.commit=function(e,t,r){return s.call(i,e,t,r)},this.strict=n;var u=this._modules.root.state;_(this,u,[],this._modules.root),S(this,u),r.forEach((function(e){return e(t)}))},z={state:{configurable:!0}};W.prototype.install=function(e,t){e.provide(t||b,this),e.config.globalProperties.$store=this,void 0!==this._devtools&&this._devtools&&T(e,this)},z.state.get=function(){return this._state.data},z.state.set=function(e){0},W.prototype.commit=function(e,t,r){var n=this,o=A(e,t,r),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),u=this._mutations[i];u&&(this._withCommit((function(){u.forEach((function(e){e(a)}))})),this._subscribers.slice().forEach((function(e){return e(s,n.state)})))},W.prototype.dispatch=function(e,t){var r=this,n=A(e,t),o=n.type,i=n.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(a,r.state)}))}catch(e){0}var u=s.length>1?Promise.all(s.map((function(e){return e(i)}))):s[0](i);return new Promise((function(e,t){u.then((function(t){try{r._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(a,r.state)}))}catch(e){0}e(t)}),(function(e){try{r._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(a,r.state,e)}))}catch(e){0}t(e)}))}))}},W.prototype.subscribe=function(e,t){return j(e,this._subscribers,t)},W.prototype.subscribeAction=function(e,t){return j("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},W.prototype.watch=function(e,t,r){var o=this;return(0,n.watch)((function(){return e(o.state,o.getters)}),t,Object.assign({},r))},W.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._state.data=e}))},W.prototype.registerModule=function(e,t,r){void 0===r&&(r={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),_(this,this.state,e,this._modules.get(e),r.preserveState),S(this,this.state)},W.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){delete E(t.state,e.slice(0,-1))[e[e.length-1]]})),x(this)},W.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},W.prototype.hotUpdate=function(e){this._modules.update(e),x(this,!0)},W.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(W.prototype,z);Q((function(e,t){var r={};return J(t).forEach((function(t){var n=t.key,o=t.val;r[n]=function(){var t=this.$store.state,r=this.$store.getters;if(e){var n=Z(this.$store,"mapState",e);if(!n)return;t=n.context.state,r=n.context.getters}return"function"==typeof o?o.call(this,t,r):t[o]},r[n].vuex=!0})),r}));var G=Q((function(e,t){var r={};return J(t).forEach((function(t){var n=t.key,o=t.val;r[n]=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var n=this.$store.commit;if(e){var i=Z(this.$store,"mapMutations",e);if(!i)return;n=i.context.commit}return"function"==typeof o?o.apply(this,[n].concat(t)):n.apply(this.$store,[o].concat(t))}})),r})),H=Q((function(e,t){var r={};return J(t).forEach((function(t){var n=t.key,o=t.val;o=e+o,r[n]=function(){if(!e||Z(this.$store,"mapGetters",e))return this.$store.getters[o]},r[n].vuex=!0})),r}));Q((function(e,t){var r={};return J(t).forEach((function(t){var n=t.key,o=t.val;r[n]=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var n=this.$store.dispatch;if(e){var i=Z(this.$store,"mapActions",e);if(!i)return;n=i.context.dispatch}return"function"==typeof o?o.apply(this,[n].concat(t)):n.apply(this.$store,[o].concat(t))}})),r}));function J(e){return function(e){return Array.isArray(e)||O(e)}(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function Q(e){return function(t,r){return"string"!=typeof t?(r=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,r)}}function Z(e,t,r){return e._modulesNamespaceMap[r]}var X=r(6649);function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t{"use strict";r.d(t,{Z:()=>i});var n=r(311);const o={props:["resourceName","field"],mixins:[r(5691).Z]};const i=(0,r(3744).Z)(o,[["render",function(e,t,r,o,i,a){return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,(0,n.toDisplayString)(e.formattedValue),1)}]])},6649:(e,t,r)=>{function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=n(r(3950)),i=r(8009),a=n(r(6533));function s(){return(s=Object.assign||function(e){for(var t=1;t0&&"back_forward"===window.performance.getEntriesByType("navigation")[0].type},r.handleBackForwardVisit=function(e){var t=this;window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then((function(){t.restoreScrollPositions(),b(e)}))},r.locationVisit=function(e,t){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:t})),window.location.href=e.href,v(window.location).href===v(e).href&&window.location.reload()}catch(e){return!1}},r.isLocationVisit=function(){try{return null!==window.sessionStorage.getItem("inertiaLocationVisit")}catch(e){return!1}},r.handleLocationVisit=function(e){var t,r,n,o,i=this,a=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=null!=(t=null==(r=window.history.state)?void 0:r.rememberedState)?t:{},e.scrollRegions=null!=(n=null==(o=window.history.state)?void 0:o.scrollRegions)?n:[],this.setPage(e,{preserveScroll:a.preserveScroll,preserveState:!0}).then((function(){a.preserveScroll&&i.restoreScrollPositions(),b(e)}))},r.isLocationVisitResponse=function(e){return e&&409===e.status&&e.headers["x-inertia-location"]},r.isInertiaResponse=function(e){return null==e?void 0:e.headers["x-inertia"]},r.createVisitId=function(){return this.visitId={},this.visitId},r.cancelVisit=function(e,t){var r=t.cancelled,n=void 0!==r&&r,o=t.interrupted,i=void 0!==o&&o;!e||e.completed||e.cancelled||e.interrupted||(e.cancelToken.cancel(),e.onCancel(),e.completed=!1,e.cancelled=n,e.interrupted=i,g(e),e.onFinish(e))},r.finishVisit=function(e){e.cancelled||e.interrupted||(e.completed=!0,e.cancelled=!1,e.interrupted=!1,g(e),e.onFinish(e))},r.resolvePreserveOption=function(e,t){return"function"==typeof e?e(t):"errors"===e?Object.keys(t.props.errors||{}).length>0:e},r.visit=function(e,r){var n=this,i=void 0===r?{}:r,a=i.method,u=void 0===a?t.n$.GET:a,l=i.data,p=void 0===l?{}:l,d=i.replace,g=void 0!==d&&d,b=i.preserveScroll,w=void 0!==b&&b,O=i.preserveState,j=void 0!==O&&O,x=i.only,S=void 0===x?[]:x,_=i.headers,P=void 0===_?{}:_,E=i.errorBag,A=void 0===E?"":E,k=i.forceFormData,F=void 0!==k&&k,I=i.onCancelToken,N=void 0===I?function(){}:I,T=i.onBefore,C=void 0===T?function(){}:T,R=i.onStart,M=void 0===R?function(){}:R,D=i.onProgress,L=void 0===D?function(){}:D,V=i.onFinish,U=void 0===V?function(){}:V,B=i.onCancel,$=void 0===B?function(){}:B,q=i.onSuccess,W=void 0===q?function(){}:q,z=i.onError,G=void 0===z?function(){}:z,H=i.queryStringArrayFormat,J=void 0===H?"brackets":H,Q="string"==typeof e?h(e):e;if(!function e(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some((function(t){return e(t)}))||"object"==typeof t&&null!==t&&Object.values(t).some((function(t){return e(t)}))}(p)&&!F||p instanceof FormData||(p=f(p)),!(p instanceof FormData)){var Z=y(u,Q,p,J),X=Z[1];Q=h(Z[0]),p=X}var K={url:Q,method:u,data:p,replace:g,preserveScroll:w,preserveState:j,only:S,headers:P,errorBag:A,forceFormData:F,queryStringArrayFormat:J,cancelled:!1,completed:!1,interrupted:!1};if(!1!==C(K)&&function(e){return m("before",{cancelable:!0,detail:{visit:e}})}(K)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Y=this.createVisitId();this.activeVisit=s({},K,{onCancelToken:N,onBefore:C,onStart:M,onProgress:L,onFinish:U,onCancel:$,onSuccess:W,onError:G,queryStringArrayFormat:J,cancelToken:o.CancelToken.source()}),N({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(e){m("start",{detail:{visit:e}})}(K),M(K),o({method:u,url:v(Q).href,data:u===t.n$.GET?{}:p,params:u===t.n$.GET?p:{},cancelToken:this.activeVisit.cancelToken.token,headers:s({},P,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},S.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":S.join(",")}:{},A&&A.length?{"X-Inertia-Error-Bag":A}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(e){p instanceof FormData&&(e.percentage=Math.round(e.loaded/e.total*100),function(e){m("progress",{detail:{progress:e}})}(e),L(e))}}).then((function(e){var t;if(!n.isInertiaResponse(e))return Promise.reject({response:e});var r=e.data;S.length&&r.component===n.page.component&&(r.props=s({},n.page.props,r.props)),w=n.resolvePreserveOption(w,r),(j=n.resolvePreserveOption(j,r))&&null!=(t=window.history.state)&&t.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=Q,i=h(r.url);return o.hash&&!i.hash&&v(o).href===i.href&&(i.hash=o.hash,r.url=i.href),n.setPage(r,{visitId:Y,replace:g,preserveScroll:w,preserveState:j})})).then((function(){var e=n.page.props.errors||{};if(Object.keys(e).length>0){var t=A?e[A]?e[A]:{}:e;return function(e){m("error",{detail:{errors:e}})}(t),G(t)}return m("success",{detail:{page:n.page}}),W(n.page)})).catch((function(e){if(n.isInertiaResponse(e.response))return n.setPage(e.response.data,{visitId:Y});if(n.isLocationVisitResponse(e.response)){var t=h(e.response.headers["x-inertia-location"]),r=Q;r.hash&&!t.hash&&v(r).href===t.href&&(t.hash=r.hash),n.locationVisit(t,!0===w)}else{if(!e.response)return Promise.reject(e);m("invalid",{cancelable:!0,detail:{response:e.response}})&&c.show(e.response.data)}})).then((function(){n.activeVisit&&n.finishVisit(n.activeVisit)})).catch((function(e){if(!o.isCancel(e)){var t=m("exception",{cancelable:!0,detail:{exception:e}});if(n.activeVisit&&n.finishVisit(n.activeVisit),t)return Promise.reject(e)}}))}},r.setPage=function(e,t){var r=this,n=void 0===t?{}:t,o=n.visitId,i=void 0===o?this.createVisitId():o,a=n.replace,s=void 0!==a&&a,u=n.preserveScroll,c=void 0!==u&&u,l=n.preserveState,f=void 0!==l&&l;return Promise.resolve(this.resolveComponent(e.component)).then((function(t){i===r.visitId&&(e.scrollRegions=e.scrollRegions||[],e.rememberedState=e.rememberedState||{},(s=s||h(e.url).href===window.location.href)?r.replaceState(e):r.pushState(e),r.swapComponent({component:t,page:e,preserveState:f}).then((function(){c||r.resetScrollPositions(),s||b(e)})))}))},r.pushState=function(e){this.page=e,window.history.pushState(e,"",e.url)},r.replaceState=function(e){this.page=e,window.history.replaceState(e,"",e.url)},r.handlePopstateEvent=function(e){var t=this;if(null!==e.state){var r=e.state,n=this.createVisitId();Promise.resolve(this.resolveComponent(r.component)).then((function(e){n===t.visitId&&(t.page=r,t.swapComponent({component:e,page:r,preserveState:!1}).then((function(){t.restoreScrollPositions(),b(r)})))}))}else{var o=h(this.page.url);o.hash=window.location.hash,this.replaceState(s({},this.page,{url:o.href})),this.resetScrollPositions()}},r.get=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({},n,{method:t.n$.GET,data:r}))},r.reload=function(e){return void 0===e&&(e={}),this.visit(window.location.href,s({},e,{preserveScroll:!0,preserveState:!0}))},r.replace=function(e,t){var r;return void 0===t&&(t={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(r=t.method)?r:"get")+"() instead."),this.visit(e,s({preserveState:!0},t,{replace:!0}))},r.post=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.n$.POST,data:r}))},r.put=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.n$.PUT,data:r}))},r.patch=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.n$.PATCH,data:r}))},r.delete=function(e,r){return void 0===r&&(r={}),this.visit(e,s({preserveState:!0},r,{method:t.n$.DELETE}))},r.remember=function(e,t){var r,n;void 0===t&&(t="default"),w||this.replaceState(s({},this.page,{rememberedState:s({},null==(r=this.page)?void 0:r.rememberedState,(n={},n[t]=e,n))}))},r.restore=function(e){var t,r;if(void 0===e&&(e="default"),!w)return null==(t=window.history.state)||null==(r=t.rememberedState)?void 0:r[e]},r.on=function(e,t){var r=function(e){var r=t(e);e.cancelable&&!e.defaultPrevented&&!1===r&&e.preventDefault()};return document.addEventListener("inertia:"+e,r),function(){return document.removeEventListener("inertia:"+e,r)}},e}(),j={buildDOMElement:function(e){var t=document.createElement("template");t.innerHTML=e;var r=t.content.firstChild;if(!e.startsWith("