From b42720cafd68df3972456636009a7813f657ef22 Mon Sep 17 00:00:00 2001 From: Rafael Milewski Date: Wed, 25 Oct 2023 23:41:31 +0800 Subject: [PATCH] Fix double delete button on index view (#5) --- README.md | 6 +- composer.json | 2 +- config/nova.php | 4 +- dist/css/tool.css | 2 +- dist/js/tool.js | 2 +- dist/js/tool.js.LICENSE.txt | 9 ++ nova.mix.js | 1 + package.json | 4 +- resources/js/components/ActionDropdown.vue | 2 +- resources/js/components/ActionSelector.vue | 6 +- resources/js/components/IconActionToolbar.vue | 10 +- yarn.lock | 116 +++++++++--------- 12 files changed, 91 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index a6a88b0..94cffd0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ composer require digital-creative/icon-action-toolbar ## Basic Usage -All you need to do is append an `->icon()` to all your actions, it accepts either an icon name from heroicons v1 or inlined svg string. +All you need to do is append an `->icon()` to all your actions, it accepts either an icon name from [heroicons](https://heroicons.com/) or inlined svg string. ```php class UserResource extends Resource @@ -49,8 +49,8 @@ You can customize the icons by adding the following to your nova config file: 'vendors' => [ 'icon_action_toolbar' => [ 'icons' => [ - 'replicate' => 'duplicate', - 'preview' => 'document-search', + 'replicate' => 'square-2-stack', + 'preview' => 'viewfinder-circle', 'impersonate' => 'finger-print', 'delete_resource' => '...', ], diff --git a/composer.json b/composer.json index 4b048be..23e5831 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "license": "MIT", "require": { "php": ">=8.1", - "laravel/nova": "^4.0" + "laravel/nova": "^4.28.0" }, "autoload": { "psr-4": { diff --git a/config/nova.php b/config/nova.php index 5bca369..3cd4d7c 100644 --- a/config/nova.php +++ b/config/nova.php @@ -4,8 +4,8 @@ return [ 'icons' => [ - 'replicate' => 'duplicate', - 'preview' => 'document-search', + 'replicate' => 'square-2-stack', + 'preview' => 'viewfinder-circle', 'impersonate' => 'finger-print', 'delete_resource' => 'trash', ], diff --git a/dist/css/tool.css b/dist/css/tool.css index 70e8281..7d2d2b5 100644 --- a/dist/css/tool.css +++ b/dist/css/tool.css @@ -1 +1 @@ -.icon-action-toolbar :is(.ml-1){margin-left:.25rem}.icon-action-toolbar :is(.flex){display:flex}.icon-action-toolbar :is(.table){display:table}.icon-action-toolbar :is(.h-9){height:2.25rem}.icon-action-toolbar :is(.w-9){width:2.25rem}.icon-action-toolbar :is(.w-full){width:100%}.icon-action-toolbar :is(.justify-evenly){justify-content:space-evenly}.icon-action-toolbar :is(.rounded){border-radius:.25rem}.icon-action-toolbar :is(.rounded-lg){border-radius:.5rem}.icon-action-toolbar :is(.bg-gray-100){background-color:rgba(var(--colors-gray-100))}.icon-action-toolbar :is(.bg-gray-700){background-color:rgba(var(--colors-gray-700))}.icon-action-toolbar :is(.bg-transparent){background-color:transparent}.icon-action-toolbar :is(.px-2){padding-left:.5rem;padding-right:.5rem}.icon-action-toolbar :is(.px-3){padding-left:.75rem;padding-right:.75rem}.icon-action-toolbar :is(.text-left){text-align:left}.icon-action-toolbar :is(.text-gray-400){color:rgba(var(--colors-gray-400))}.icon-action-toolbar :is(.text-primary-500){color:rgba(var(--colors-primary-500))}.icon-action-toolbar :is(.text-red-500){color:rgba(var(--colors-red-500))}.icon-action-toolbar :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.icon-action-toolbar :is(.hover\:bg-gray-200:hover){background-color:rgba(var(--colors-gray-200))}.icon-action-toolbar :is(.hover\:text-gray-400:hover){color:rgba(var(--colors-gray-400))}.icon-action-toolbar :is(.hover\:text-primary-500:hover){color:rgba(var(--colors-primary-500))}.icon-action-toolbar :is(.hover\:text-red-500:hover){color:rgba(var(--colors-red-500))}.icon-action-toolbar :is(.focus\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}.icon-action-toolbar :is(.focus\:ring:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.icon-action-toolbar :is(.disabled\:pointer-events-none:disabled){pointer-events:none}.icon-action-toolbar :is(.disabled\:opacity-50:disabled){opacity:.5}.icon-action-toolbar :is(.dark .dark\:bg-gray-700){background-color:rgba(var(--colors-gray-700))}.icon-action-toolbar :is(.dark .dark\:hover\:bg-gray-800:hover){background-color:rgba(var(--colors-gray-800))}.icon-action-toolbar :is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-color:rgba(var(--colors-gray-600))} +.icon-action-toolbar :is(.ml-1){margin-left:.25rem}.icon-action-toolbar :is(.flex){display:flex}.icon-action-toolbar :is(.table){display:table}.icon-action-toolbar :is(.h-9){height:2.25rem}.icon-action-toolbar :is(.w-9){width:2.25rem}.icon-action-toolbar :is(.w-full){width:100%}.icon-action-toolbar :is(.justify-evenly){justify-content:space-evenly}.icon-action-toolbar :is(.rounded){border-radius:.25rem}.icon-action-toolbar :is(.rounded-lg){border-radius:.5rem}.icon-action-toolbar :is(.bg-gray-700){background-color:rgba(var(--colors-gray-700))}.icon-action-toolbar :is(.bg-gray-700\/5){background-color:rgba(var(--colors-gray-700),.05)}.icon-action-toolbar :is(.bg-transparent){background-color:transparent}.icon-action-toolbar :is(.px-2){padding-left:.5rem;padding-right:.5rem}.icon-action-toolbar :is(.px-3){padding-left:.75rem;padding-right:.75rem}.icon-action-toolbar :is(.text-left){text-align:left}.icon-action-toolbar :is(.text-gray-400){color:rgba(var(--colors-gray-400))}.icon-action-toolbar :is(.text-primary-500){color:rgba(var(--colors-primary-500))}.icon-action-toolbar :is(.text-red-500){color:rgba(var(--colors-red-500))}.icon-action-toolbar :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.icon-action-toolbar :is(.hover\:bg-gray-200:hover){background-color:rgba(var(--colors-gray-200))}.icon-action-toolbar :is(.hover\:text-gray-400:hover){color:rgba(var(--colors-gray-400))}.icon-action-toolbar :is(.hover\:text-primary-500:hover){color:rgba(var(--colors-primary-500))}.icon-action-toolbar :is(.hover\:text-red-500:hover){color:rgba(var(--colors-red-500))}.icon-action-toolbar :is(.focus\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}.icon-action-toolbar :is(.focus\:ring:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.icon-action-toolbar :is(.disabled\:pointer-events-none:disabled){pointer-events:none}.icon-action-toolbar :is(.disabled\:opacity-50:disabled){opacity:.5}.icon-action-toolbar :is(.dark .dark\:bg-gray-700){background-color:rgba(var(--colors-gray-700))}.icon-action-toolbar :is(.dark .dark\:text-gray-400){color:rgba(var(--colors-gray-400))}.icon-action-toolbar :is(.dark .dark\:hover\:bg-gray-800:hover){background-color:rgba(var(--colors-gray-800))}.icon-action-toolbar :is(.dark .dark\:hover\:text-primary-500:hover){color:rgba(var(--colors-primary-500))}.icon-action-toolbar :is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-color:rgba(var(--colors-gray-600))} diff --git a/dist/js/tool.js b/dist/js/tool.js index 1d46ae9..4844902 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1,2 +1,2 @@ /*! For license information please see tool.js.LICENSE.txt */ -(()=>{var e,t={9750:(e,t,r)=>{"use strict";const n=Vue;var o=r(3906),i=r.n(o),a={nested:{type:Boolean,default:!1},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)}},mode:{type:String,default:"form",validator:function(e){return["form","modal","action-modal","action-fullscreen"].includes(e)}}};function s(e){return i()(a,e)}function c(){return"undefined"!=typeof navigator&&"undefined"!=typeof window?window:void 0!==r.g?r.g:{}}const u="function"==typeof Proxy,l="devtools-plugin:setup";let f,p;function d(){return void 0!==f||("undefined"!=typeof window&&window.performance?(f=!0,p=window.performance):void 0!==r.g&&(null===(e=r.g.perf_hooks)||void 0===e?void 0:e.performance)?(f=!0,p=r.g.perf_hooks.performance):f=!1),f?p.now():Date.now();var e}class h{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:()=>d()},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 y(e,t){const r=e,n=c(),o=c().__VUE_DEVTOOLS_GLOBAL_HOOK__,i=u&&r.enableEarlyProxy;if(!o||!n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__&&i){const e=i?new h(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(l,e,t)}var v="store";function m(e,t){Object.keys(e).forEach((function(r){return t(e[r],r)}))}function g(e){return null!==e&&"object"==typeof e}function b(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 w(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;O(e,r,[],e._modules.root,!0),x(e,r,t)}function x(e,t,r){var o=e._state,i=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var a=e._wrappedGetters,s={},c={},u=(0,n.effectScope)(!0);u.run((function(){m(a,(function(t,r){s[r]=function(e,t){return function(){return e(t)}}(t,e),c[r]=(0,n.computed)((function(){return s[r]()})),Object.defineProperty(e.getters,r,{get:function(){return c[r].value},enumerable:!0})}))})),e._state=(0,n.reactive)({data:t}),e._scope=u,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})),i&&i.stop()}function O(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=j(t,r.slice(0,-1)),c=r[r.length-1];e._withCommit((function(){s[c]=n.state}))}var u=n.context=function(e,t,r){var n=""===t,o={dispatch:n?e.dispatch:function(r,n,o){var i=_(r,n,o),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=t+c),e.dispatch(c,a)},commit:n?e.commit:function(r,n,o){var i=_(r,n,o),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=t+c),e.commit(c,a,s)}};return Object.defineProperties(o,{getters:{get:n?function(){return e.getters}:function(){return S(e,t)}},state:{get:function(){return j(e.state,r)}}}),o}(e,a,r);n.forEachMutation((function(t,r){!function(e,t,r,n){var o=e._mutations[t]||(e._mutations[t]=[]);o.push((function(t){r.call(e,n.state,t)}))}(e,a+r,t,u)})),n.forEachAction((function(t,r){var n=t.root?r:a+r,o=t.handler||t;!function(e,t,r,n){var o=e._actions[t]||(e._actions[t]=[]);o.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,u)})),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,u)})),n.forEachChild((function(n,i){O(e,t,r.concat(i),n,o)}))}function S(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 j(e,t){return t.reduce((function(e,t){return e[t]}),e)}function _(e,t,r){return g(e)&&e.type&&(r=t,t=e,e=e.type),{type:e,payload:t,options:r}}var E="vuex:mutations",P="vuex:actions",A="vuex",k=0;function R(e,t){y({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:E,label:"Vuex Mutations",color:T}),r.addTimelineLayer({id:P,label:"Vuex Actions",color:T}),r.addInspector({id:A,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),r.on.getInspectorTree((function(r){if(r.app===e&&r.inspectorId===A)if(r.filter){var n=[];I(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[L(t._modules.root,"")]})),r.on.getInspectorState((function(r){if(r.app===e&&r.inspectorId===A){var n=r.nodeId;S(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]=M((function(){return e[r]}))}else t[r]=M((function(){return e[r]}))})),t}(t);o.getters=Object.keys(i).map((function(e){return{key:e.endsWith("/")?C(e):e,editable:!1,value:M((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===A){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(A),r.sendInspectorState(A),r.addTimelineEvent({layerId:E,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=k++,e._time=Date.now(),n.state=t,r.addTimelineEvent({layerId:P,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:P,event:{time:Date.now(),title:e.type,groupId:e._id,subtitle:"end",data:n}})}})}))}var T=8702998,N={label:"namespaced",textColor:16777215,backgroundColor:6710886};function C(e){return e&&"root"!==e?e.split("/").slice(-2,-1)[0]:"Root"}function L(e,t){return{id:t||"root",label:C(t),tags:e.namespaced?[N]:[],children:Object.keys(e._children).map((function(r){return L(e._children[r],t+r+"/")}))}}function I(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?[N]:[]}),Object.keys(t._children).forEach((function(o){I(e,t._children[o],r,n+o+"/")}))}function M(e){try{return e()}catch(e){return e}}var D=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)||{}},F={namespaced:{configurable:!0}};F.namespaced.get=function(){return!!this._rawModule.namespaced},D.prototype.addChild=function(e,t){this._children[e]=t},D.prototype.removeChild=function(e){delete this._children[e]},D.prototype.getChild=function(e){return this._children[e]},D.prototype.hasChild=function(e){return e in this._children},D.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)},D.prototype.forEachChild=function(e){m(this._children,e)},D.prototype.forEachGetter=function(e){this._rawModule.getters&&m(this._rawModule.getters,e)},D.prototype.forEachAction=function(e){this._rawModule.actions&&m(this._rawModule.actions,e)},D.prototype.forEachMutation=function(e){this._rawModule.mutations&&m(this._rawModule.mutations,e)},Object.defineProperties(D.prototype,F);var $=function(e){this.register([],e,!1)};function B(e,t,r){if(t.update(r),r.modules)for(var n in r.modules){if(!t.getChild(n))return void 0;B(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){B([],this.root,e)},$.prototype.register=function(e,t,r){var n=this;void 0===r&&(r=!0);var o=new D(t,r);0===e.length?this.root=o:this.get(e.slice(0,-1)).addChild(e[e.length-1],o);t.modules&&m(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 U=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._scope=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 c=this._modules.root.state;O(this,c,[],this._modules.root),x(this,c),r.forEach((function(e){return e(t)}))},V={state:{configurable:!0}};U.prototype.install=function(e,t){e.provide(t||v,this),e.config.globalProperties.$store=this,void 0!==this._devtools&&this._devtools&&R(e,this)},V.state.get=function(){return this._state.data},V.state.set=function(e){0},U.prototype.commit=function(e,t,r){var n=this,o=_(e,t,r),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),c=this._mutations[i];c&&(this._withCommit((function(){c.forEach((function(e){e(a)}))})),this._subscribers.slice().forEach((function(e){return e(s,n.state)})))},U.prototype.dispatch=function(e,t){var r=this,n=_(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 c=s.length>1?Promise.all(s.map((function(e){return e(i)}))):s[0](i);return new Promise((function(e,t){c.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)}))}))}},U.prototype.subscribe=function(e,t){return b(e,this._subscribers,t)},U.prototype.subscribeAction=function(e,t){return b("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},U.prototype.watch=function(e,t,r){var o=this;return(0,n.watch)((function(){return e(o.state,o.getters)}),t,Object.assign({},r))},U.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._state.data=e}))},U.prototype.registerModule=function(e,t,r){void 0===r&&(r={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),O(this,this.state,e,this._modules.get(e),r.preserveState),x(this,this.state)},U.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){delete j(t.state,e.slice(0,-1))[e[e.length-1]]})),w(this)},U.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},U.prototype.hotUpdate=function(e){this._modules.update(e),w(this,!0)},U.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(U.prototype,V);H((function(e,t){var r={};return W(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=J(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 z=H((function(e,t){var r={};return W(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=J(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})),q=H((function(e,t){var r={};return W(t).forEach((function(t){var n=t.key,o=t.val;o=e+o,r[n]=function(){if(!e||J(this.$store,"mapGetters",e))return this.$store.getters[o]},r[n].vuex=!0})),r})),G=H((function(e,t){var r={};return W(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=J(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 W(e){return function(e){return Array.isArray(e)||g(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 H(e){return function(t,r){return"string"!=typeof t?(r=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,r)}}function J(e,t,r){return e._modulesNamespaceMap[r]}var K=r(6649),Q=r(5543),X=r.n(Q);function Z(e){return Boolean(!X()(e)&&""!==e)}function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function ee(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 te(e){for(var t=1;t1?window.history.back():!this.navigateBackUsingHistory&&Z(e)?Nova.visit(e,{replace:!0}):Nova.visit("/")}}),te({},q(["canLeaveForm","canLeaveFormToPreviousPage"]));function ne(e){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ne(e)}function oe(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 ie(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function Se(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}G(["syncQueryString","updateQueryString"]),q(["queryStringParams"]);var je=r(9964),_e=r.n(je);var Ee=r(7267),Pe=r.n(Ee);function Ae(e,t){var r=Nova.config("translations")[e]?Nova.config("translations")[e]:e;return Pe()(t,(function(e,t){if(t=new String(t),null!==e){e=new String(e);for(var n=[":"+t,":"+t.toUpperCase(),":"+t.charAt(0).toUpperCase()+t.slice(1)],o=[e,e.toUpperCase(),e.charAt(0).toUpperCase()+e.slice(1)],i=n.length-1;i>=0;i--)r=r.replace(n[i],o[i])}else console.error("Translation '".concat(r,"' for key '").concat(t,"' contains a null replacement."))})),r}s(["resourceName"]),s(["resourceName","viaRelationship"]),le()((function(e){return e()}),500);Boolean;r(3418);var ke=r(1423),Re=r.n(ke);r(9200),r(2442);function Te(e){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(e)}function Ne(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 Ce(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function Ve(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}var ze=$e().__;function qe(e,t,r){var o=(0,n.reactive)({working:!1,errors:new we.D1,actionModalVisible:!1,responseModalVisible:!1,selectedActionKey:"",endpoint:e.endpoint||"/nova-api/".concat(e.resourceName,"/action"),actionResponseData:null}),i=(0,n.computed)((function(){return e.selectedResources})),a=(0,n.computed)((function(){if(o.selectedActionKey)return _e()(s.value,(function(e){return e.uriKey===o.selectedActionKey}))})),s=(0,n.computed)((function(){var t;return e.actions.concat((null===(t=e.pivotActions)||void 0===t?void 0:t.actions)||[])})),c=(0,n.computed)((function(){return r.getters["".concat(e.resourceName,"/currentEncodedFilters")]})),u=(0,n.computed)((function(){return e.viaRelationship?e.viaRelationship+"_search":e.resourceName+"_search"})),l=(0,n.computed)((function(){return r.getters.queryStringParams[u.value]||""})),f=(0,n.computed)((function(){return e.viaRelationship?e.viaRelationship+"_trashed":e.resourceName+"_trashed"})),p=(0,n.computed)((function(){return r.getters.queryStringParams[f.value]||""})),d=(0,n.computed)((function(){return ce()(e.actions,(function(e){return i.value.length>0&&!e.standalone}))})),h=(0,n.computed)((function(){return e.pivotActions?ce()(e.pivotActions.actions,(function(e){return 0!==i.value.length||e.standalone})):[]})),y=(0,n.computed)((function(){return h.value.length>0})),v=(0,n.computed)((function(){return y.value&&Boolean(_e()(e.pivotActions.actions,(function(e){return e===a.value})))})),m=(0,n.computed)((function(){return{action:o.selectedActionKey,pivotAction:v.value,search:l.value,filters:c.value,trashed:p.value,viaResource:e.viaResource,viaResourceId:e.viaResourceId,viaRelationship:e.viaRelationship}})),g=(0,n.computed)((function(){return Me()(new FormData,(function(e){e.append("resources",i.value),Re()(a.value.fields,(function(t){t.fill(e)}))}))}));function b(){a.value.withoutConfirmation?_():w()}function w(){o.actionModalVisible=!0}function x(){o.actionModalVisible=!1}function O(){o.responseModalVisible=!0}function S(e){t("actionExecuted"),Nova.$emit("action-executed"),"function"==typeof e&&e()}function j(e){if(e.danger)return Nova.error(e.danger);Nova.success(e.message||ze("The action was executed successfully."))}function _(e){var t;o.working=!0,Nova.$progress.start();var r=null!==(t=a.value.responseType)&&void 0!==t?t:"json";Nova.request({method:"post",url:o.endpoint,params:m.value,data:g.value,responseType:r}).then(function(){var t,r=(t=Ue().mark((function t(r){return Ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:x(),E(r.data,r.headers,e);case 2:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(e){Ve(i,n,o,a,s,"next",e)}function s(e){Ve(i,n,o,a,s,"throw",e)}a(void 0)}))});return function(e){return r.apply(this,arguments)}}()).catch((function(e){e.response&&422===e.response.status&&("blob"===r?e.response.data.text().then((function(e){o.errors=new we.D1(JSON.parse(e).errors)})):o.errors=new we.D1(e.response.data.errors),Nova.error(ze("There was a problem executing the action.")))})).finally((function(){o.working=!1,Nova.$progress.done()}))}function E(e,t,r){var n=t["content-disposition"];if(!(e instanceof Blob&&X()(n)&&"application/json"===e.type))return e instanceof Blob?S((function(){var t="unknown",r=window.URL.createObjectURL(new Blob([e])),o=document.createElement("a");if(o.href=r,n){var i=n.split(";")[1].match(/filename=(.+)/);2===i.length&&(t=Fe()(i[1],'"'))}o.setAttribute("download",t),document.body.appendChild(o),o.click(),o.remove(),window.URL.revokeObjectURL(r)})):e.modal?(o.actionResponseData=e,j(e),O()):e.download?S((function(){j(e);var t=document.createElement("a");t.href=e.download,t.download=e.name,document.body.appendChild(t),t.click(),document.body.removeChild(t)})):e.deleted?S((function(){return j(e)})):(e.redirect&&(window.location=e.redirect),e.visit?(j(e),Nova.visit({url:Nova.url(e.visit.path,e.visit.options),remote:!1})):e.openInNewTab?S((function(){return window.open(e.openInNewTab,"_blank")})):void S((function(){return j(e)})));e.text().then((function(e){E(JSON.parse(e),t)}))}return{errors:(0,n.computed)((function(){return o.errors})),working:(0,n.computed)((function(){return o.working})),actionModalVisible:(0,n.computed)((function(){return o.actionModalVisible})),responseModalVisible:(0,n.computed)((function(){return o.responseModalVisible})),selectedActionKey:(0,n.computed)((function(){return o.selectedActionKey})),determineActionStrategy:b,setSelectedActionKey:function(e){o.selectedActionKey=e},openConfirmationModal:w,closeConfirmationModal:x,openResponseModal:O,closeResponseModal:function(){o.responseModalVisible=!1},handleActionClick:function(e){o.selectedActionKey=e,b()},selectedAction:a,allActions:s,availableActions:d,availablePivotActions:h,executeAction:_,actionResponseData:(0,n.computed)((function(){return o.actionResponseData}))}}var Ge=["onClick"],We=["innerHTML"],He={key:3,class:"ml-1"};const Je={emits:["click"],props:["actions","standalone","parentType"],computed:{isDetailView:function(){return"Nova.Detail"===Nova.$router.page.component&&"DetailActionDropdown.vue"===this.parentType}}};var Ke=r(3379),Qe=r.n(Ke),Xe=r(6763),Ze={insert:"head",singleton:!1};Qe()(Xe.Z,Ze);Xe.Z.locals;const Ye=(0,r(3744).Z)(Je,[["render",function(e,t,r,o,i,a){var s=(0,n.resolveComponent)("Icon"),c=(0,n.resolveDirective)("tooltip");return r.actions.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)([{rounded:r.standalone,"rounded-lg bg-gray-100 dark:bg-gray-700":!r.standalone},"flex dark:focus:ring-gray-600 justify-evenly"])},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.actions,(function(t){var o,i=t.iconActionToolbar,u=t.destructive,l=t.uriKey,f=t.name;return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[i?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("button",{key:0,type:"button",onClick:(0,n.withModifiers)((function(){return e.$emit("click",l)}),["stop"]),class:(0,n.normalizeClass)([{"h-9 w-9":!a.isDetailView&&!r.standalone,"hover:text-red-500":u&&!a.isDetailView,"hover:text-primary-500":!u&&!a.isDetailView,"rounded hover:bg-gray-200 dark:hover:bg-gray-800 focus:outline-none focus:ring px-3 hover:text-gray-400":r.standalone&&a.isDetailView},"toolbar-button px-2 disabled:opacity-50 disabled:pointer-events-none"])},["string"!=typeof i.icon?((0,n.openBlock)(),(0,n.createBlock)(s,{key:0,type:"cube-transparent"})):null!==(o=i.icon)&&void 0!==o&&null!==(o=o.trim())&&void 0!==o&&o.startsWith("e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";r.d(t,{Z:()=>i});var n=r(3645),o=r.n(n)()((function(e){return e[1]}));o.push([e.id,"div[dusk$=detail-component] div.icon-action-toolbar{margin-left:0;margin-right:0}table div.icon-action-toolbar .hover-element:hover{background-color:transparent!important}table div.icon-action-toolbar .hover-element button>div{padding-left:.75rem;padding-right:.75rem}",""]);const i=o},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i{},3379:(e,t,r)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r{"use strict";t.Z=(e,t)=>{const r=e.__vccOpts||e;for(const[e,n]of t)r[e]=n;return r}},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?Object.assign.bind():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,c=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,x=i.preserveState,O=void 0!==x&&x,S=i.only,j=void 0===S?[]:S,_=i.headers,E=void 0===_?{}:_,P=i.errorBag,A=void 0===P?"":P,k=i.forceFormData,R=void 0!==k&&k,T=i.onCancelToken,N=void 0===T?function(){}:T,C=i.onBefore,L=void 0===C?function(){}:C,I=i.onStart,M=void 0===I?function(){}:I,D=i.onProgress,F=void 0===D?function(){}:D,$=i.onFinish,B=void 0===$?function(){}:$,U=i.onCancel,V=void 0===U?function(){}:U,z=i.onSuccess,q=void 0===z?function(){}:z,G=i.onError,W=void 0===G?function(){}:G,H=i.queryStringArrayFormat,J=void 0===H?"brackets":H,K="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)&&!R||p instanceof FormData||(p=f(p)),!(p instanceof FormData)){var Q=y(c,K,p,J),X=Q[1];K=h(Q[0]),p=X}var Z={url:K,method:c,data:p,replace:g,preserveScroll:w,preserveState:O,only:j,headers:E,errorBag:A,forceFormData:R,queryStringArrayFormat:J,cancelled:!1,completed:!1,interrupted:!1};if(!1!==L(Z)&&function(e){return m("before",{cancelable:!0,detail:{visit:e}})}(Z)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Y=this.createVisitId();this.activeVisit=s({},Z,{onCancelToken:N,onBefore:L,onStart:M,onProgress:F,onFinish:B,onCancel:V,onSuccess:q,onError:W,queryStringArrayFormat:J,cancelToken:o.CancelToken.source()}),N({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(e){m("start",{detail:{visit:e}})}(Z),M(Z),o({method:c,url:v(K).href,data:c===t.n$.GET?{}:p,params:c===t.n$.GET?p:{},cancelToken:this.activeVisit.cancelToken.token,headers:s({},E,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},j.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":j.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),F(e))}}).then((function(e){var t;if(!n.isInertiaResponse(e))return Promise.reject({response:e});var r=e.data;j.length&&r.component===n.page.component&&(r.props=s({},n.page.props,r.props)),w=n.resolvePreserveOption(w,r),(O=n.resolvePreserveOption(O,r))&&null!=(t=window.history.state)&&t.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=K,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:O})})).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),W(t)}return m("success",{detail:{page:n.page}}),q(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=K;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}})&&u.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,c=n.preserveScroll,u=void 0!==c&&c,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(){u||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}(),O={buildDOMElement:function(e){var t=document.createElement("template");t.innerHTML=e;var r=t.content.firstChild;if(!e.startsWith("